r2d2_postgres 0.18.1

Postgres support for the r2d2 connection pool
Documentation
restore_registry: &RESTORE_REGISTRY
  restore_cache:
    key: registry

save_registry: &SAVE_REGISTRY
  save_cache:
    key: registry-{{ .BuildNum }}
    paths:
      - /usr/local/cargo/registry/index

deps_key: &DEPS_KEY
  key: deps-1.43.0-{{ checksum "Cargo.lock" }}-2

restore_deps: &RESTORE_DEPS
  restore_cache:
    <<: *DEPS_KEY

save_deps: &SAVE_DEPS
  save_cache:
    <<: *DEPS_KEY
    paths:
      - target
      - /usr/local/cargo/registry/cache

version: 2
jobs:
  build:
    docker:
      - image: rust:1.43.0
      - image: postgres:12
        environment:
          POSTGRES_PASSWORD: password
    steps:
      - checkout
      - *RESTORE_REGISTRY
      - run: cargo generate-lockfile
      - *SAVE_REGISTRY
      - *RESTORE_DEPS
      - run: cargo test
      - *SAVE_DEPS