Skip to content

Implications of running statements directly in IO #35

@torgeirsh

Description

@torgeirsh

Since "Session a" is isomorphic to "Connection -> IO (Either QueryError a)", it's relatively simple to integrate it with a custom application monad when using plain Hasql. With Hasql.Pool things get a bit more complicated, because the "use" function says it relies on the QueryError to determine if a connection is lost. What will happen if an application handles the QueryError in a different way, e.g. by logging it, and then "use" is only called when there's no QueryError (i.e. the return value of the IO action inside the Session passed to "use" is always "Right a")? Would a temporary connection problem then poison the pool and eventually make it impossible for the application to connect, or is that not an issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions