Module
Droplet.Driver.Internal.Query
- Package
- purescript-droplet
- Repository
- easafe/purescript-droplet
#FromResult Source
class FromResult :: RowList Type -> Type -> Constraint
class FromResult (projection :: RowList Type) result | projection -> result where
Members
Instances
FromResult Nil (Record ())
(FromValue t, FromResult rest (Record restProjection), IsSymbol name, Lacks name restProjection, Cons name t restProjection projection) => FromResult (Cons name t rest) (Record projection)
#PGErrorDetail Source
type PGErrorDetail = { code :: String, column :: String, constraint :: String, dataType :: String, detail :: String, error :: Error, file :: String, hint :: String, internalPosition :: String, internalQuery :: String, line :: String, message :: String, position :: String, routine :: String, schema :: String, severity :: String, table :: String, where_ :: String }
#PgError Source
data PgError
Constructors
ClientError Error String
ConversionError String
InternalError PGErrorDetail
OperationalError PGErrorDetail
ProgrammingError PGErrorDetail
IntegrityError PGErrorDetail
DataError PGErrorDetail
NotSupportedError PGErrorDetail
QueryCanceledError PGErrorDetail
TransactionRollbackError PGErrorDetail
TooManyRows
Instances
#unsafeExecute Source
unsafeExecute :: forall parameters pra. RowToList parameters pra => ToParameters parameters pra => Connection -> Maybe Plan -> String -> Record parameters -> Aff (Maybe PgError)
#unsafeQuery Source
unsafeQuery :: forall projection pro parameters pra. RowToList projection pro => RowToList parameters pra => ToParameters parameters pra => FromResult pro (Record projection) => Connection -> Maybe Plan -> String -> Record parameters -> Aff (Either PgError (Array (Record projection)))
#unsafeSingle Source
unsafeSingle :: forall parameters pra projection pro. RowToList parameters pra => ToParameters parameters pra => RowToList projection pro => FromResult pro (Record projection) => Connection -> Maybe Plan -> String -> Record parameters -> Aff (Either PgError (Maybe (Record projection)))
#withConnection Source
withConnection :: forall a. Pool -> (Either PgError Connection -> Aff a) -> Aff a
Runs queries with a connection
#withTransaction Source
withTransaction :: forall a. Pool -> (Connection -> Aff a) -> Aff (Either PgError a)
Runs queries within a transaction
- Modules
- Droplet.
Driver - Droplet.
Driver. Internal. Pool - Droplet.
Driver. Internal. Query - Droplet.
Driver. Unsafe - Droplet.
Language - Droplet.
Language. Internal. Condition - Droplet.
Language. Internal. Definition - Droplet.
Language. Internal. Function - Droplet.
Language. Internal. Keyword - Droplet.
Language. Internal. Query - Droplet.
Language. Internal. Syntax
Those instances are required for testing.