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, Reflectable name String, 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)
Runs a query without results from a SQL string
#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)))
Returns an array of projection
records from a SQL string
#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)))
Runs a query that returns zero or one results from a SQL string
#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. Migration - Droplet.
Driver. Internal. Pool - Droplet.
Driver. Internal. Query - Droplet.
Driver. Migration - Droplet.
Driver. Unsafe - Droplet.
Language - Droplet.
Language. Internal. Condition - Droplet.
Language. Internal. Definition - Droplet.
Language. Internal. Function - Droplet.
Language. Internal. Syntax - Droplet.
Language. Internal. Token - Droplet.
Language. Internal. Translate
Those instances are required for testing.