Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Database.Beam.Sqlite.Connection
- module Database.Beam.Sqlite.Migrate
- data SqliteCommandSyntax
- data SqliteSyntax
- data SqliteSelectSyntax
- data SqliteInsertSyntax
- data SqliteUpdateSyntax
- data SqliteDeleteSyntax
- fromSqliteCommand :: SqliteCommandSyntax -> SqliteSyntax
- sqliteRenderSyntaxScript :: SqliteSyntax -> ByteString
Documentation
module Database.Beam.Sqlite.Migrate
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
.
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.
data SqliteSelectSyntax Source #
SQLite SELECT
syntax
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
.
data SqliteUpdateSyntax Source #
SQLite UPDATE
syntax
data SqliteDeleteSyntax Source #
SQLite DELETE
syntax
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.