beam-sqlite-0.3.2.3: Beam driver for SQLite

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Sqlite.Migrate

Contents

Description

Migrations support for SQLite databases

Synopsis

beam-migrate CLI support

beam-migrate utility functions

migrateScript :: MigrationSteps SqliteCommandSyntax () a -> [ByteString] Source #

Render a series of MigrationSteps in the SqliteCommandSyntax into a line-by-line list of lazy BL'ByteStrings. The output is suitable for inclusion in a migration script. Comments are generated giving a description of each migration step.

sqlitePredConverter :: HaskellPredicateConverter Source #

HaskellPredicateConverter that can convert all constraints generated by getDbConstaints into their equivalent in the beam-migrate haskell syntax. Suitable for auto-generation of a haskell migration.

sqliteTypeToHs :: SqliteDataTypeSyntax -> Maybe HsDataType Source #

Convert a SQLite data type to the corresponding Haskell one

getDbConstraints :: SqliteM [SomeDatabasePredicate] Source #

Get a list of database predicates for the current database. This is beam's best guess at providing a schema for the current database. Note that SQLite type names are not standardized, and the so-called column "affinities" are too broad to be of use. This function attemps to guess a good enough type based on the exact type supplied in the CREATE TABLE commands. It will correctly parse any type generated by beam and most SQL compliant types, but it may falter on databases created or managed by tools that do not follow these standards.

SQLite-specific data types