Polymorphic backend version for withPostgresqlPool and co

Abierto
#1,643 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
haskell
Área
database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)

Lenguaje dominante
Haskell
Estrellas
486
Forks
307
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de yesodweb/persistent

Todos los issues de yesodweb/persistent

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.