packages feed

shikumi-cache-postgres-0.1.3.1: shikumi-cache-postgres.cabal

cabal-version: 3.4
name: shikumi-cache-postgres
version: 0.1.3.1
synopsis: Postgres-backed shikumi cache (EP-6)
category: AI
description:
  A PostgreSQL backend for shikumi's @Cache@ effect (EP-6), in a separate
  package so the @hasql@ client (and libpq) is only pulled in when used. Entries
  live in a @shikumi_cache(key text primary key, value jsonb, stored_at
  timestamptz)@ table, upserted on conflict; the value is the JSON of a
  @CachedResponse@ (the @Response@ round-trip comes from @shikumi-cache@'s
  @Shikumi.Cache.ResponseJSON@). The test uses @ephemeral-pg@ to spin up a
  throwaway server, so it needs no external database.

license: BSD-3-Clause
author: Nadeem Bitar
maintainer: nadeem@gmail.com
build-type: Simple
extra-doc-files: CHANGELOG.md

common common-options
  ghc-options:
    -Wall
    -Wcompat
    -Widentities
    -Wincomplete-uni-patterns
    -Wincomplete-record-updates
    -Wredundant-constraints
    -fhide-source-paths
    -Wmissing-export-lists
    -Wpartial-fields
    -Wmissing-deriving-strategies

  default-language: GHC2024
  default-extensions:
    DeriveAnyClass
    DuplicateRecordFields
    MultilineStrings
    OverloadedLabels
    OverloadedStrings

library
  import: common-options
  hs-source-dirs: src
  exposed-modules: Shikumi.Cache.Backend.Postgres
  build-depends:
    aeson >=2.2 && <2.3,
    base >=4.20 && <5,
    effectful >=2.6 && <2.8,
    hasql >=1.10 && <1.11,
    shikumi-cache ^>=0.2.0.1,
    text ^>=2.1,

test-suite shikumi-cache-postgres-test
  import: common-options
  type: exitcode-stdio-1.0
  hs-source-dirs: test
  main-is: Main.hs
  ghc-options:
    -threaded
    -with-rtsopts=-N

  build-depends:
    baikai >=0.7.1.0 && <0.8,
    base,
    effectful,
    ephemeral-pg ^>=0.3.1.0,
    generic-lens,
    lens,
    shikumi ^>=0.4.0.0,
    shikumi-cache ^>=0.2.0.1,
    shikumi-cache-postgres ^>=0.1.3.1,
    tasty,
    tasty-hunit,
    text,
    time,
    vector,