HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleselda-0.5.2.1Haskell2010

Database.Selda.Backend.Internal

Internal backend API. Using anything exported from this module may or may not invalidate any safety guarantees made by Selda; use at your own peril.

  • 18 types
  • 2 classes
  • 14 values
  • Packageselda-0.5.2.1
  • Exports34
  • LanguageHaskell2010
  • LicenceMIT
  • SourceInternal.hs
newtypenewtype StmtID
#

A prepared statement identifier. Guaranteed to be unique per application.

Constructors

Instances3Eq, Ord, Show
  • Eq StmtIDDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Ord StmtIDDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Show StmtIDDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
datadata BackendID
#

Uniquely identifies some particular backend.

When publishing a new backend, consider submitting a pull request with a constructor for your backend instead of using the Other constructor.

Instances3Eq, Ord, Show
  • Eq BackendIDDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Ord BackendIDDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Show BackendIDDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
typetype QueryRunner a = Text -> [Param] -> IO a
#

A function which executes a query and gives back a list of extensible tuples; one tuple per result row, and one tuple element per column.

datadata SeldaBackend b
#

A collection of functions making up a Selda backend.

Constructors

datadata SeldaConnection b
#

Constructors

datadata SeldaStmt
#

A prepared statement.

Constructors

  • SeldaStmt
    • stmtHandle :: !Dynamic

      Backend-specific handle to the prepared statement.

    • stmtText :: !Text

      The SQL code for the statement.

    • stmtParams :: ![Either Int Param]

      All parameters to be passed to the prepared statement. Parameters that are unique to each invocation are specified as indices starting at 0. Backends implementing runPrepared should probably ignore this field.

classclass MonadIO m => MonadSelda (m :: Type -> Type) where
#

Some monad with Selda SQL capabilitites.

Associated types

Methods

  • withConnection :: (SeldaConnection (Backend m) -> m a) -> m a

    Pass a Selda connection to the given computation and execute it. After the computation finishes, withConnection is free to do anything it likes to the connection, including closing it or giving it to another Selda computation. Thus, the computation must take care never to return or otherwise access the connection after returning.

  • transact :: m a -> m a

    Perform the given computation as a transaction. Implementations must ensure that subsequent calls to withConnection within the same transaction always passes the same connection to its argument.

Instances1MonadSelda
newtypenewtype SeldaT b (m :: Type -> Type) a
#

Monad transformer adding Selda SQL capabilities.

Constructors

Instances11MonadTrans, Monad, Functor, MonadFail, Applicative, MonadIO, …
datadata SeldaError
#

Thrown by any function in SeldaT if an error occurs.

Constructors

Instances3Eq, Show, Exception
  • Eq SeldaErrorDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Show SeldaErrorDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Exception SeldaErrorDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
datadata Param where
#

A parameter to a prepared SQL statement.

Constructors

Instances3Eq, Ord, Show
  • Eq ParamDefined in selda-0.5.2.1 · Database.Selda.SQL
  • Ord ParamDefined in selda-0.5.2.1 · Database.Selda.SQL
  • Show ParamDefined in selda-0.5.2.1 · Database.Selda.SQL
datadata Lit a where
#

An SQL literal.

Instances3Eq, Ord, Show
  • Eq (Lit a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
  • Ord (Lit a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
  • Show (Lit a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
datadata ColAttr
#

Column attributes such as nullability, auto increment, etc. When adding elements, make sure that they are added in the order required by SQL syntax, as this list is only sorted before being pretty-printed.

Instances3Eq, Ord, Show
  • Eq ColAttrDefined in selda-0.5.2.1 · Database.Selda.Table.Type
  • Ord ColAttrDefined in selda-0.5.2.1 · Database.Selda.Table.Type
  • Show ColAttrDefined in selda-0.5.2.1 · Database.Selda.Table.Type
classclass Typeable a => SqlType a where
#

Any datatype representable in (Selda's subset of) SQL.

Methods

Instances19SqlType, …
datadata PPConfig
#

Backend-specific configuration for the SQL pretty-printer.

Constructors

valuedefPPConfig :: PPConfig
#

Default settings for pretty-printing. Geared towards SQLite.

The default definition of ppTypePK is 'defType, so that you don’t have to do anything special if you don’t use special types for primary keys.

datadata TableInfo
#

Comprehensive information about a table.

Constructors

Instances2Eq, Show
  • Eq TableInfoDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Show TableInfoDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
datadata ColumnInfo
#

Comprehensive information about a column.

Constructors

Instances2Eq, Show
  • Eq ColumnInfoDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Show ColumnInfoDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
valuesqlDateFormat :: String
#

Format string used to represent date when representing dates as text. If at all possible, use SqlDate instead.

valuesqlTimeFormat :: String
#

Format string used to represent time of day when representing time as text. If at all possible, use SqlTime instead.