beam-sqlite-0.5.2.0: Beam driver for SQLite
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Beam.Sqlite

Synopsis

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

Instances details
IsSql92Syntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

IsSql92DdlCommandSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

type Sql92DeleteSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

type Sql92InsertSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

type Sql92SelectSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

type Sql92UpdateSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

type Sql92DdlCommandAlterTableSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

type Sql92DdlCommandCreateTableSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

type Sql92DdlCommandDropTableSyntax SqliteCommandSyntax Source # 
Instance details

Defined in Database.Beam.Sqlite.Syntax

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.

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.