Polymorphic backend version for withPostgresqlPool and co

Aperta
#1,643 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
haskell
Ambito
database

Direzione di ricerca

Start by locating withPostgresqlPool and related APIs in the persistent-postgresql package, then read the Pool SqlBackend type and how SqlReadBackend is defined and used. Determine whether the API can expose a suitably constrained polymorphic backend while preserving existing callers; done means the interface provides the requested read-only instantiation and relevant package checks pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

persistent-postgresql currently exposes an interface which only provides Pool SqlBackend. However, this makes it so that we cannot guarantee that callers inside will perform no write operations. If the interface could instead be changed to provide a polymorphic backend with proper constraints, we could then potentially instantiate to SqlReadBackend and have some slightly stronger guarantees about what kinds of operations are happening inside.

Is there some reason to not do that?

EDIT: I just realised I can just coerce the pool to get what I want, but I think providing the nicer interface out of the box would still be more convenient (and potentially easier to grasp for newcomers)

Lingua principale
Haskell
Stelle
486
Fork
307
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di yesodweb/persistent

Tutte le issue di yesodweb/persistent

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.