Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Beam.Sqlite
Synopsis
- module Database.Beam.Sqlite.Connection
- sqliteText :: DataType Sqlite Text
- sqliteBlob :: DataType Sqlite ByteString
- sqliteBigInt :: DataType Sqlite Int64
- data SqliteCommandSyntax
- data SqliteSyntax
- data SqliteSelectSyntax
- data SqliteInsertSyntax
- data SqliteUpdateSyntax
- data SqliteDeleteSyntax
- fromSqliteCommand :: SqliteCommandSyntax -> SqliteSyntax
- sqliteRenderSyntaxScript :: SqliteSyntax -> ByteString
- sqliteGroupConcat :: (BeamSqlBackendCanSerialize Sqlite a, BeamSqlBackendIsString Sqlite str, BeamSqlBackendIsString Sqlite str2) => QExpr Sqlite s a -> QExpr Sqlite s str -> QAgg Sqlite s (Maybe str2)
- sqliteGroupConcatOver :: (BeamSqlBackendCanSerialize Sqlite a, BeamSqlBackendIsString Sqlite str) => Maybe SqliteAggregationSetQuantifierSyntax -> QExpr Sqlite s a -> QAgg Sqlite s (Maybe str)
Documentation
SQLite syntaxes
data SqliteCommandSyntax Source #
A SQLite command. INSERT
is special cased to handle AUTO INCREMENT
columns. The fromSqliteCommand
function will take an SqliteCommandSyntax
and convert it into the correct SqliteSyntax
.
Instances
data SqliteSyntax Source #
The syntax for SQLite is stored as a Builder
along with a list of data
that hasn't been serialized yet.
The first argument is a function that receives a builder for SQLData
and
returns the concrete syntax to embed into the query. For queries sent to the
backend, this is simply a function that returns "?"
. Thus, the syntax sent
to the backend includes proper placeholders. The list of data is sent to the
SQLite library for proper escaping.
When the syntax is being serialized for display (for use in beam migrate for example), the data builder attempts to properly format and escape the data. This returns syntax suitable for inclusion in scripts. In this case, the value list is ignored.
Instances
Eq SqliteSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax | |
Show SqliteSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Methods showsPrec :: Int -> SqliteSyntax -> ShowS # show :: SqliteSyntax -> String # showList :: [SqliteSyntax] -> ShowS # | |
Semigroup SqliteSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Methods (<>) :: SqliteSyntax -> SqliteSyntax -> SqliteSyntax # sconcat :: NonEmpty SqliteSyntax -> SqliteSyntax # stimes :: Integral b => b -> SqliteSyntax -> SqliteSyntax # | |
Monoid SqliteSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Methods mempty :: SqliteSyntax # mappend :: SqliteSyntax -> SqliteSyntax -> SqliteSyntax # mconcat :: [SqliteSyntax] -> SqliteSyntax # | |
Hashable SqliteSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax | |
Sql92DisplaySyntax SqliteSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Methods displaySyntax :: SqliteSyntax -> String # |
data SqliteSelectSyntax Source #
SQLite SELECT
syntax
Instances
IsSql92SelectSyntax SqliteSelectSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Associated Types type Sql92SelectSelectTableSyntax SqliteSelectSyntax :: Type # | |
type Sql92SelectOrderingSyntax SqliteSelectSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax | |
type Sql92SelectSelectTableSyntax SqliteSelectSyntax Source # | |
data SqliteInsertSyntax Source #
SQLite INSERT
syntax. This doesn't directly wrap SqliteSyntax
because
we need to do some processing on INSERT
statements to deal with AUTO
INCREMENT
columns. Use formatSqliteInsert
to turn SqliteInsertSyntax
into SqliteSyntax
.
Instances
IsSql92InsertSyntax SqliteInsertSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Associated Types type Sql92InsertValuesSyntax SqliteInsertSyntax :: Type # type Sql92InsertTableNameSyntax SqliteInsertSyntax :: Type # | |
type Sql92InsertTableNameSyntax SqliteInsertSyntax Source # | |
type Sql92InsertValuesSyntax SqliteInsertSyntax Source # | |
data SqliteUpdateSyntax Source #
SQLite UPDATE
syntax
Instances
IsSql92UpdateSyntax SqliteUpdateSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Associated Types type Sql92UpdateTableNameSyntax SqliteUpdateSyntax :: Type # type Sql92UpdateFieldNameSyntax SqliteUpdateSyntax :: Type # type Sql92UpdateExpressionSyntax SqliteUpdateSyntax :: Type # | |
type Sql92UpdateExpressionSyntax SqliteUpdateSyntax Source # | |
type Sql92UpdateFieldNameSyntax SqliteUpdateSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax | |
type Sql92UpdateTableNameSyntax SqliteUpdateSyntax Source # | |
data SqliteDeleteSyntax Source #
SQLite DELETE
syntax
Instances
IsSql92DeleteSyntax SqliteDeleteSyntax Source # | |
Defined in Database.Beam.Sqlite.Syntax Associated Types type Sql92DeleteTableNameSyntax SqliteDeleteSyntax :: Type # type Sql92DeleteExpressionSyntax SqliteDeleteSyntax :: Type # | |
type Sql92DeleteExpressionSyntax SqliteDeleteSyntax Source # | |
type Sql92DeleteTableNameSyntax SqliteDeleteSyntax Source # | |
fromSqliteCommand :: SqliteCommandSyntax -> SqliteSyntax Source #
Convert a SqliteCommandSyntax
into a renderable SqliteSyntax
sqliteRenderSyntaxScript :: SqliteSyntax -> ByteString Source #
Render a SqliteSyntax
as a lazy ByteString
, for purposes of
displaying to a user. Embedded SQLData
is directly embedded into the
concrete syntax, with a best effort made to escape strings.
Sqlite functions and aggregates
sqliteGroupConcat :: (BeamSqlBackendCanSerialize Sqlite a, BeamSqlBackendIsString Sqlite str, BeamSqlBackendIsString Sqlite str2) => QExpr Sqlite s a -> QExpr Sqlite s str -> QAgg Sqlite s (Maybe str2) Source #
The SQLite group_concat
function.
Joins the value in each row of the first argument, using the second
argument as a delimiter. See sqliteGroupConcatOver
if you want to provide
explicit quantification.
sqliteGroupConcatOver :: (BeamSqlBackendCanSerialize Sqlite a, BeamSqlBackendIsString Sqlite str) => Maybe SqliteAggregationSetQuantifierSyntax -> QExpr Sqlite s a -> QAgg Sqlite s (Maybe str) Source #
The SQLite group_concat
function.
Joins the value in each row of the first argument using ','.
See sqliteGroupConcat
if you want to change the delimiter.
Choosing a custom delimiter and quantification isn't allowed by SQLite.