!8 R      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./01234 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X YZ [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                       None&',.147=>?@AHSUVXk1{ beam-migrate!es that can be serialized to JSON beam-migrate!es that can be serialized to JSONA beam-migrate0Type classes for syntaxes which can be displayedB beam-migrateRender the syntax as a 0, representing the SQL expression it stands forL beam-migrateTSyntax equalities for any reasonable DDL syntax, only including types defined here.M beam-migrate~Syntax equalities that any reasonable DDL syntax would follow, including equalities between beam-migrate and beam-core types.  beam-migrate On update  beam-migrate On delete $ beam-migrate Column type  beam-migrateDefault value  beam-migrateColumn constraints  beam-migrateDefault collation N   $"#!%'&(/.-,+)*0213459876:@?>=;<ABCDEFGHIJKLMNMLKJIHGFEDCAB:@?>=;<5987634021(/.-,+)*%'& $"#!  None&'.147=>?@AHMPSUVXkRN beam-migrate2Provides a collection of deserializers from aeson s for arbitrary types. The cmdX type parameter is a phantom type parameter. Notionally, all deserializers within this N relate to the cmd syntax.Q beam-migrate is too complex for us to store in JSON. Additionally, many backends provide substantial amounts of extensions to the syntax that would make storing this highly unfeasible. Expressions are therefore represented as their full text rendering.>This means that expressions only match as equal if they match exactlyo. While this may seem overly pedantic, it's not much of a concern if your migrations are generated solely by  beam-migrate?. If you've modified the schema yourself, you may have to use IsCustomSqlSyntax! to provide an exact expression.T beam-migrate type for JSONW beam-migrate type for JSONZ beam-migrate type for JSON] beam-migrate  type for JSON` beam-migrate type for JSONc beam-migrateAn ) for JSON. Supports all superclasses of  declared in  beam-core.f beam-migratekSome backends serialize data that can only be read by that backend. If so, they should wrap these data in f{, which provides a standard syntax for specifying backend specific data, as well as which backend the data are valid for.@The first argument is a string that is unique to a given backendg beam-migrateFHelper for serializing the precision and decimal count parameters to , etc.h beam-migrate+Helper function to deserialize data from a  . UbeamDeserializeMaybe _ Nothing = pure Nothing beamDeserializeMaybe d (Just v) = Just  $ beamDeserialize d v i beam-migrateFDeserialize the requested type from the given deserializers and aeson .k beam-migrate Deserializers for SQL92 syntaxesl beam-migrate.Deserializes data types that are instances of m beam-migrate-Deserialize data types that are instances of n beam-migrate,Deserialize data types that are instance of !NOPQRSTUVWXYZ[\]^_`abcdefghijklmn!cde`ab]^_Z[\WXYTUVQRSfgNOPihjklmnNone&'.147=>?@AHMSUVXkTqqNone&'.147=>?@AHSUVXks  beam-migrateEA predicate that depedns on the name of a table and one of its fields beam-migrate5A predicate that depends on the name of a domain type beam-migrateEA predicate that depends on the name of a table as well as its fields beam-migrategSome predicates make sense in any backend. Others only make sense in one. This denotes the difference. beam-migrate=A Database predicate is a value of any type which satisfies ~. We often want to store these in lists and sets, so we need a monomorphic container that can store these polymorphic values. beam-migrateA predicate is a type that describes some condition that the database schema must meet. Beam represents database schemas as the set of all predicates that apply to a database schema. The  and  instances allow us to build HashSet1s of predicates to represent schemas in this way. beam-migrateYAn english language description of this predicate. For example, "There is a table named  TableName" beam-migrateWhether or not this predicate applies to all backends or only one backend. This is used when attempting to translate schemas between backends. If you are unsure, provide 2 along with an identifier unique to your backend. beam-migrate Serialize a predicate to a JSON . beam-migrateSome predicates require other predicates to be true. For example, in order for a table to have a column, that table must exist. This function takes in the current predicate and another arbitrary database predicate. It should return K if this predicate needs the other predicate to be true in order to exist. By default, this simply returns ), which makes sense for many predicates. beam-migrateConvenience synonym for None&'.147=>?@AHSUVXky beam-migrateA data type in a given IsSql92DataTypeSyntax9 which describes a SQL type mapping to the Haskell type a beam-migrate0A schema for a field which hasn't been named yet beam-migrate)A schema for a field within a given table beam-migrateA table schema, produced by  createTableNone&'.147=>?@AHSUVXk beam-migratesAsserts that the given table has a primary key made of the given columns. The order of the columns is significant. beam-migrate Table name  beam-migrate Column names  beam-migrateIAsserts that a particular column of a table has a given constraint. The syntax) type parameter should be an instance of   beam-migrate Table name  beam-migrate Column name  beam-migrateConstraint definition  beam-migrate\Asserts that the table specified has a column with the given data type. The type paramater syntax should be an instance of  . beam-migrate Table name  beam-migrate Column name  beam-migrate Data type  beam-migrate=Asserts that a table with the given name exists in a database beam-migrate Table name  beam-migrateN. for all the predicates defined in this moduleNone&',.147=>?@AHSUVXk^ beam-migrateCConstraint synonym to use if you want to assert that a particular 6 syntax supports defaulting for a particular data type beam-migrate\Used to define a default SQL data type for a haskell type in a particular data type syntax.Beam defines instances for several standard SQL types, which are polymorphic over any standard data type syntax. Backends or extensions which provide custom types should instantiate instances of this class and P for any types they provide for which they would like checked schema migrations beam-migrate&Provide a data type for the given type beam-migrateBCertain data types also come along with constraints. For example, SERIAL* types in Postgres generate an automatic DEFAULT constraint.You need an instance of this class for any type for which you want beam to be able to infer the SQL data type. If your data type does not have any constraint requirements, you can just declare an empty instance beam-migrateEProvide arbitrary constraints on a field of the requested type. See 7 for more information on the formatting of constraints. beam-migrate#Concrete representation of the type beam-migrate2 if this field is in an embedded key or table,  otherwise beam-migrate#Concrete representation of the type beam-migrate%Concrete representation of the syntax beam-migrate0 if this field is embedded in a foreign key,  otherwise. For example, SERIAL types in postgres get a DEFAULT constraint, but SERIAL" types in a foreign key do not.None&'.147=>?@AHSUVXk  beam-migratenPurposefully opaque type describing how to modify a table field. Used to parameterize the second argument to 5. For now, the only way to construct a value is the 1 instance, which allows you to rename the field. beam-migrateIThe type of a checked database descriptor. Conceptually, this is just a  with a set of predicates. Use  to get the regular  object and  to access the predicates. beam-migrateLike  but for checked databases beam-migrateLike  in  beam-core2, but for entities against which we can generate &s. Conceptually, this is the same as +, but with one extra function to generate s from the description. beam-migrateZThe type of the descriptor for this checked entity. Usually this wraps the corresponding  from ,, along with some mechanism for generating s. beam-migrateLike  but for checked entities beam-migrateProduce the corresponding DatabaseEntityDescriptior beam-migrateProduce the set of s that apply to this entity beam-migrateLike 4 but for checked databases. Most often, this wraps % and provides some means to generate s beam-migrate Convert a  to a regular S. The return value is suitable for use in any regular beam query or DML statement. beam-migrateA  beam-migrate database schema is defined completely by the set of predicates that apply to it. This function allows you to access this definition for a  object. beam-migrateModify a checked table.nThe first argument is a function that takes the original table name as input and produces a new table name.XThe second argument gives instructions on how to rename each field in the table. Use q to create a value of this type which does no renaming. Each field in the table supplied here has the type 0. Most commonly, the programmer will use the OverloadedStrings instance to provide a new name.Examples3Rename a table, without renaming any of its fields: modifyCheckedTable (_ -> NewTblNm) checkedTableModification *Modify a table, renaming the field called _field1 in Haskell to  FirstName. Note that below,  FirstName represents a  object. <modifyCheckedTable id (checkedTableModification { _field1 =  FirstName })  beam-migrate4Produce a table field modification that does nothing1Most commonly supplied as the second argument to ; when you just want to rename the table, not the fields.None&'.14567=>?@AHMSUVXk beam-migrate0A migration command along with metadata on wheth beam-migrateThe command to run beam-migrate/Information on whether the migration loses data beam-migrateInformation on whether a j loses data. You can monoidally combine these to get the potential data loss for a sequence of commands. beam-migrateThe command loses data beam-migrateThe command keeps all data beam-migrate;A sequence of potentially reversible schema update commands beam-migrateFree monadic function for s beam-migrate,What to execute when applying the migration  beam-migrate.What to execute when unapplying the migration  beam-migrate A series of *s that take a database from the schema in from to the one in to . Use the / function and the arrow interface to sequence . beam-migrate+Represents a particular step in a migration beam-migrateURun the migration steps between the given indices, using a custom execution function. beam-migrate8Get the result of a migration, without running any steps beam-migrate:Remove the explicit source and destination schemas from a  object beam-migrate Create a 3 from the given description and migration function. beam-migrateeGiven a command in the forward direction, and an optional one in the reverse direction, construct a R that performs the given command. Multiple commands can be sequenced monadically. beam-migrateqGiven functions to render a migration step description and the underlying syntax, create a script for the given . beam-migratehExecute a given migration, provided a command to execute arbitrary syntax. You usually use this with  runNoReturn. beam-migrateDGiven a migration, get the potential data loss, if it's run top-down beam-migrateRun a ; without executing any of the commands against a database. beam-migrate,Collect the names of all steps in hte given  beam-migrate)Zero-based index of the first step to run beam-migrate"Index of the last step to run, or  to run every step beam-migrateThe set of steps to run beam-migrate\Callback for each step. Called with the step index, the step description and the migration. beam-migrate Called at the beginning of each  with the step description beam-migrate-Called for each command in the migration step beam-migrateThe set of steps to run>;None&'.147=>?@ACHMSUVXk-" beam-migrate9Represents a constraint in the given column schema syntax beam-migrateRRepresents the default value of a field with a given column schema syntax and type beam-migrateMonad representing a series of  ALTER TABLE statements  beam-migrate(A column in the process of being altered  beam-migrateAdd a  CREATE TABLE statement to this migration,The first argument is the name of the table.,The second argument is a table containing a - for each field. See documentation on the Field command for more information. beam-migrateAdd a  DROP TABLE statement to this migration. beam-migrate0Copy a table schema from one database to another beam-migrateALTER TABLE ... RENAME TO command beam-migrate(ALTER TABLE ... RENAME COLUMN ... TO ... command beam-migrateALTER TABLE ... DROP COLUMN ... command beam-migrateALTER TABLE ... ADD COLUMN ... command beam-migrateCompose a series of  ALTER TABLE commands Example usage Zmigrate (OldDb oldTbl) = do alterTable oldTbl $ oldTbl' -> field2 <- renameColumnTo NewNameForField2F (_field2 oldTbl') dropColumn (_field3 oldTbl') renameTableTo  NewTableName field4 <- addColumn (field  ANewColumn_ smallint notNull (defaultTo_ (val_ 0))) return (NewTable (_field1 oldTbl') field2 field4) (The above would result in commands like:  ALTER TABLE  oldtable RENAME COLUMN  field2 TO NewNameForField2; ALTER TABLE  oldtable DROP COLUMN  field3; ALTER TABLE  oldtable RENAME TO  NewTableName; ALTER TABLE  NewTableName ADD COLUMN  ANewColumn SMALLINT NOT NULL DEFAULT 0;  beam-migrateBuild a schema for a field. This function takes the name and type of the field and a variable number of modifiers, such as constraints and default values. GHC will complain at you if the modifiers do not make sense. For example, you cannot apply the  constraint to a column with a  type."Example of creating a table named Employee with three columns:  FirstName, LastName, and HireDate Rdata Employee f = Employee { _firstName :: C f Text , _lastName :: C f Text , _hireDate :: C f (Maybe LocalTime) } deriving Generic instance Beamable Employee instance Table Employee where data PrimaryKey Employee f = EmployeeKey (C f Text) (C f Text) deriving Generic primaryKey = EmployeeKey  $ _firstName  *8 _lastName instance Beamable PrimaryKey Employee f data EmployeeDb entity = EmployeeDb { _employees :: entity (TableEntity Employee) } deriving Generic instance Database EmployeeDb migration :: IsSql92DdlCommandSyntax syntax => Migration syntax () EmployeeDb migration = do employees <- createTable EmployeesTable# (Employee (field FirstNameFieldx (varchar (Just 15)) notNull) (field "last_name" (varchar Nothing) notNull (defaultTo_ (val_ Smithj))) (field "hiredDate" (maybeType timestamp))) return (EmployeeDb employees)  beam-migrateBuild a  from a  ?. GHC will complain if you supply more than one default value. beam-migrate The SQL92 NOT NULL constraint beam-migrateSQL UNIQUE constraint beam-migrateSQL92 INTEGER data type beam-migrateSQL92 SMALLINT data type beam-migrateSQL2008 Optional BIGINT data type beam-migrateSQL2003 Optional BINARY data type beam-migrateSQL2003 Optional  VARBINARY data type beam-migrateSQL92 DATE data type beam-migrateSQL92 CHAR data type  beam-migrateSQL92 VARCHAR data type! beam-migrateSQL92 DOUBLE data type" beam-migrateSQL92 NUMERIC data type# beam-migrateSQL92 TIMESTAMP WITH TIME ZONE data type$ beam-migrateSQL92 TIMESTAMP WITHOUT TIME ZONE data type% beam-migrateSQL92 TIME data type& beam-migrateSQL99 BOOLEAN data type' beam-migrateSQL99 CLOB data type( beam-migrateSQL99 BLOB data type) beam-migrateSQL99 array data types* beam-migrateHaskell requires 4s to match exactly. Use this function to convert a 2 that expects a concrete value to one expecting a )      !"#$%&'()*)      !'()&"%$#* None&'.147=>?@AHSUVXk94 beam-migratePUsed to designate that a field should provide a default auto-incrementing value.Usage: field Key genericSerial 1Then, when inserting into the table, you can use default_S to request the database automatically assign a new value to the column. See runInsertReturningZ for another Beam extension that may help if you want to know which value was assigned.Note that this is only provided for convenience. Backends often implement auto-incrementing keys wildly differently. Many have restrictions on where 5 may appear and may fail at run-time if these conditions aren't met. Please refer to the backend of your choice for more information.4545None&'.147=>?@AHSUVXk:~  "!#$%&'(*)+,-./0123456789:<;=>?@ABCDEFGHIJKLM      !"#$%&'()* None&'.147=>?@AHSUVXkD6 beam-migrateValid   shared among some backends.: beam-migrategSome backends use this to represent their constraint attributes. Does not need to be used in practice.= beam-migrate Options for  CREATE TABLEX. Given as a separate ADT because the options may go in different places syntactically.0You never really need to use this type directly.? beam-migrate Convert a 6 to its SQL92! representation in the returned  ByteString  .@ beam-migrate Serialize a 6 6798:<;=>?@ =>:<;6798?@None&'.147=>?@AHSUVXkF5  None&'.147=>?@AHSUVXkJY beam-migrate>Produce a checked database for the given Haskell database typeSee  9http://tathougies.github.io/beam/schema-guide/migrations/ the manual' for more information on the defaults.YY None"#&'.147=>?@AHPSUVXk%Z beam-migrate(Represents the final results of a search[ beam-migratexThe search found a path from the source to the destination database, and has provided a set of commands that would work\ beam-migrate)The search failed, but provided a set of  DatbaseStaters it encountered that were the closest to the destination database. By default, only 10 candidates are provided.] beam-migrate4Represents current state of a database graph search.If ^, the destination database has been reached, and the given list of commands provides the path from the source database to the destination.If _&, the search has failed. The provided ps represent the closest we could make it to the destination database. By default, only the best 10 are kept around (to avoid unbounded memory growth).If `, we are still searching. The caller is provided with the current state as well as a list of actions, provided as an opaque type f. The b" function can be used to get the i corresponding to any given f. The caller is free to cull the set of potential actions according however they'd like (for example, by prompting the user). The selected actions to explore should be passed to the d function. Use of the f existential type may seem obtuse, but it prevents the caller from injecting arbitrary actions. Instead the caller is limited to choosing only valid actions as provided by the suppled e.a beam-migrate#The current node we're searching atb beam-migrateConvert the opaque f type to a i. This can be used to present the actions to the user or to inspect the action to make a more informed choice on exploration strategies.c beam-migrateMThe possible actions that we can take, presented as an opaque list. Use the b$ function to get the corresponding i.d beam-migrate%Continue the search and get the next ]e beam-migrate1Edge discovery mechanism. A newtype wrapper over h.An h] takes two arguments. The first is the set of predicates that exist in the current database.:The function should a set of edges from the database specified in the first argument to possible destination databases. For optimization purposes, the second argument is the set of predicates that ought to exist in the destination database. This can be used to eliminate edges that will not lead to a solution.This second argument is just an optimization and doesn't change the final result, although it can significantly impact the time it takes to get there.Both the current database set and the destination database set are given as polymorphic lists of predicates. When you instantiate the type, the current database predicate set is queried for predicates of that type. For example, { provides a  DROP TABLEh action edge whenever it encounters a table that exists. In order to do this, it attempts to find all 5 that do not exist in the destination database. Its h may be implemented like such: dropTableActionProvider preConditions postConditions = do TableExistsPredicate srcTblNm <- preConditions ensuringNot_ $ $ do TableExistsPredicate destTblNm <- postConditions guard (srcTblNm == destTblNm)x is a function that causes the action provider to return no results if there are any elements in the provided list. In this case, it's used to stop  DROP TABLEK action generation for tables which must be present in the final database.h beam-migrateSee ei beam-migrate5Represents an edge (or a path) in the database graph.eGiven a particular starting point, the destination database is the database where each predicate in k) has been removed and each predicate in l has been added.k beam-migrate'Preconditions that will no longer applyl beam-migrate+Conditions that will apply after we're donem beam-migrate\The sequence of commands that accomplish this movement in the database graph. For an edge, m9 contains one command; for a path, it will contain more.n beam-migrate&An english description of the movemento beam-migrate_A heuristic notion of complexity or weight; used to find the "easiest" path through the graph.  beam-migrate Wrapper for px that keeps track of the command sequence length and goal distance. Used for sorting states when conducting the search.p beam-migrateDRepresents the state of a database as a migration is being generatedr beam-migraterThe current set of predicates that apply to this database as well as their source (user or from previous actions)s beam-migrateHS.fromMap of r, for maximal sharingt beam-migrateAThe current sequence of commands we've committed to in this stateu beam-migrateUsed to indicate whether a particular predicate is from the initial database state, or due to a sequence of actions we've committed too. Used to prevent runaway action generation based off of derived states.v beam-migrate4Predicate is from the original set given by the userw beam-migrateCPredicate is from an action we've committed to in this action chainx beam-migrateTProceeds only if no predicate matches the given pattern. See the implementation of { for an example of usage.y beam-migrate]Used to ensure that only one predicate matches the given pattern. See the implementation of z for an example of usage.z beam-migrateAction provider for SQL92  CREATE TABLE actions.{ beam-migrateAction provider for SQL92  DROP TABLE actions| beam-migrateAction provider for SQL92 ALTER TABLE ... ADD COLUMN ... actions beam-migrateAction provider for SQL92 ALTER TABLE ... DROP COLUMN ... actions} beam-migrateAction provider for SQL92 )ALTER TABLE ... ALTER COLUMN ... SET NULL~ beam-migrateAction provider for SQL92 .ALTER TABLE ... ALTER COLUMN ... SET NOT NULL beam-migrate8Default action providers for any SQL92 compliant syntax.JIn particular, this provides edges consisting of the following statements: CREATE TABLE DROP TABLEALTER TABLE ... ADD COLUMN ...ALTER TABLE ... DROP COLUMN .../ALTER TABLE ... ALTER COLUMN ... SET [NOT] NULL beam-migrateReturns  if the state has been solved beam-migrateAn exhaustive solving strategy that simply continues the search, while exploring every possible action. If there is a solution, this will find it. beam-migrateConduct a breadth-first search of the database graph to find a path from the source database to the destination database, using the given eB to discovere "edges" (i.e., DDL commands) between the databases.See the documentation on ]4 for more information on how to consume the result. beam-migratei;s can represent edges or paths. Monadically combining two iZs results in the path between the source of the first and the destination of the second. b here returns the action that does nothing (i.e., the edge going back to the same database state) beam-migrateEdge discovery function beam-migrateSource database state beam-migrateDestination database state(Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(uvwpqrstijklmnoefghxyz{|}~]^_`abcdZ[\ None&'.147=>?@AHSUVXk  beam-migratedIn order to support Haskell schema generation, backends need to provide a way to convert arbitrary DatabasePredicates generated by the backend's  function into appropriate predicates in the Haskell syntax. Not all predicates have any meaning when translated to Haskell, so backends can choose to drop any predicate (simply return ). beam-migratePMonomorphic wrapper for use with plugin loaders that cannot handle polymorphism beam-migrate_Backends should create a value of this type and export it in an exposed module under the name migrationBackend1. See the module documentation for more details. beam-migratelType of errors that can be thrown by backends during DDL statement execution. Currently just a synonym for  beam-migrateConverters for the , , and R (when supplied with a function to convert a backend data type to a haskell one). beam-migrateConverter for G, when given a function to convert backend data type to a haskell one. beam-migrate>Some predicates have no dependence on a backend. For example, V has no parameters that depend on the backend. It can be converted straightforwardly: )trivialHsConverter @TableExistsPredicate  beam-migrateTUtility function for converting a monomorphically typed predicate to a haskell one. beam-migrates can be combined monoidally.None&'.147=>?@AHSUVXk  "!#$%&'(*)+,-./0123456789:<;=>?@ABCDEFGHIJKLM      !"#$%&'()*YZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None&'.147=>?@AHSUVXkMNone&'.147=>?@AHSUVXk  beam-migrateResult type for  beam-migrateICalled before we're about to run an irreversible migration step. Return  to run the step, or  to abort immediately. beam-migrateHCalled at the beginning of each step with the step index and description beam-migrateBCalled at the end of each step with the step index and description beam-migrateCalled before a command is about to run. The first argument is the step index and the second is a string representing the command about to be run. beam-migrateCalled when a query fails beam-migrateGCalled when the migration log has a discontinuity at the supplied index beam-migrateThe migration log at the given index is not what was expected. The first text is the actual commit id, the second, the expected beam-migrateThe database is ahead of the given migrations. The parameter supplies the number of entries passed the given migrations the database has. beam-migrateDefault set of M. Refuses to run irreversible migrations, and fails in case of error, using . beam-migrateEquivalent to calling  with .NTries to bring the database up to date, using the database log and the given =. Fails if the migration is irreversible, or an error occurs. beam-migrateCheck for the beam-migrate log. If it exists, use it and the supplied migrations to bring the database up-to-date. Otherwise, create the log and run all migrations.ZAccepts a set of hooks that can be used to customize behavior. See the documentation for * for more information. Calling this with  is the same as using . beam-migrate&Attempt to find a SQL schema given an e" and a checked database. Returns M if no schema could be found, which usually means you have chosen the wrong e(, or the backend you're using is buggy. beam-migrateGiven a  and a E, attempt to create the schema from scratch in the current database.May  if we cannot find a schema beam-migrateGiven a Q, attempt to automatically bring the current database up-to-date with the given . Fails (via Q) if this involves an irreversible migration (one that may result in data loss). beam-migrateGiven a migration backend, a handle to a database, and a checked database, attempt to find a schema. This should always return 8, unless the backend has incomplete migrations support.*s can usually be found in a module named Database.Beam. Backend.Migrate with the namemigrationBackend beam-migrateUVerify that the given, beam database matches the actual schema. On success, returns , on failure, returns " and a list of missing predicates. beam-migrate(Run a sequence of commands on a database beam-migrate+Given a function to convert a command to a o, produce a script that will execute the given migration. Usually, the function you provide eventually calls  displaySyntax to rendere the command. beam-migrateGiven a j, get a string representing a Haskell module that would be a good starting point for further development.+For example, for a postgres database named chinook 0import Database.Beam.Migrate.Simple import Database.Beam.Postgres (runBeamPostgres) import Database.Beam.Postgres.Migrate (migrationBackend) import Database.PostgreSQL.Simple getSchema :: IO String getSchema = do pg <- connectPostgreSQL runBeamPostgres pg (haskellSchema migrationBackend)RBackends that have a migration backend typically export it under the module name Database.Beam.Backend.Migrate.}Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abccdeefgghiijkklmmnoopqqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~          ! " # $ % & & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @A B C D E F G H I J K L M M N O P P Q R S T U V V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z z { { | | } ~                                                             *beam-migrate-0.3.2.2-8TQ5bU498b3kHywULxhbDDatabase.Beam.Migrate.SQL.SQL92#Database.Beam.Migrate.SerializationDatabase.Beam.Haskell.SyntaxDatabase.Beam.Migrate.TypesDatabase.Beam.Migrate.SQLDatabase.Beam.Migrate.ChecksDatabase.Beam.Migrate.Generics Database.Beam.Migrate.SQL.Tables(Database.Beam.Migrate.SQL.BeamExtensions!Database.Beam.Migrate.SQL.BuilderDatabase.Beam.Migrate.ActionsDatabase.Beam.Migrate.BackendDatabase.Beam.Migrate.LogDatabase.Beam.Migrate.Simple&Database.Beam.Migrate.Types.PredicatesDatabase.Beam.Migrate.SQL.Types%Database.Beam.Migrate.Generics.Tables+Database.Beam.Migrate.Types.CheckedEntities$Database.Beam.Migrate.Generics.TypesDatabase.Beam.Migrate+Sql92SerializableConstraintDefinitionSyntaxserializeConstraintSql92SerializableDataTypeSyntaxserializeDataTypeIsSql92ColumnConstraintSyntax$Sql92ColumnConstraintMatchTypeSyntax,Sql92ColumnConstraintReferentialActionSyntax%Sql92ColumnConstraintExpressionSyntaxnotNullConstraintSyntaxuniqueColumnConstraintSyntax primaryKeyColumnConstraintSyntaxcheckColumnConstraintSyntaxreferencesConstraintSyntax!IsSql92ConstraintAttributesSyntax initiallyDeferredAttributeSyntax!initiallyImmediateAttributeSyntaxnotDeferrableAttributeSyntaxdeferrableAttributeSyntax'IsSql92ColumnConstraintDefinitionSyntax/Sql92ColumnConstraintDefinitionConstraintSyntax/Sql92ColumnConstraintDefinitionAttributesSyntaxconstraintDefinitionSyntaxIsSql92ReferentialActionSyntaxreferentialActionCascadeSyntaxreferentialActionSetNullSyntax!referentialActionSetDefaultSyntaxreferentialActionNoActionSyntaxIsSql92MatchTypeSyntaxfullMatchSyntaxpartialMatchSyntaxIsSql92TableConstraintSyntaxprimaryKeyConstraintSyntaxIsSql92ColumnSchemaSyntax!Sql92ColumnSchemaColumnTypeSyntax!Sql92ColumnSchemaExpressionSyntax1Sql92ColumnSchemaColumnConstraintDefinitionSyntaxcolumnSchemaSyntaxIsSql92AlterColumnActionSyntaxsetNotNullSyntax setNullSyntaxIsSql92AlterTableActionSyntax&Sql92AlterTableAlterColumnActionSyntax!Sql92AlterTableColumnSchemaSyntaxalterColumnSyntaxaddColumnSyntaxdropColumnSyntaxrenameTableToSyntaxrenameColumnToSyntaxIsSql92AlterTableSyntax%Sql92AlterTableAlterTableActionSyntaxalterTableSyntaxIsSql92DropTableSyntaxdropTableSyntaxIsSql92CreateTableSyntax"Sql92CreateTableColumnSchemaSyntax%Sql92CreateTableTableConstraintSyntaxSql92CreateTableOptionsSyntaxcreateTableSyntaxIsSql92DdlCommandSyntax Sql92DdlCommandCreateTableSyntaxSql92DdlCommandAlterTableSyntaxSql92DdlCommandDropTableSyntaxcreateTableCmd dropTableCmd alterTableCmdSql92DisplaySyntax displaySyntax%Sql92DdlCommandAlterTableActionSyntax)Sql92DdlCommandConstraintAttributesSyntax&Sql92DdlCommandReferentialActionSyntaxSql92DdlCommandMatchTypeSyntax%Sql92DdlCommandColumnConstraintSyntax$Sql92DdlColumnSchemaConstraintSyntax)Sql92DdlCommandConstraintDefinitionSyntax!Sql92DdlCommandColumnSchemaSyntaxSql92DdlCommandDataTypeSyntax$Sql92SaneDdlCommandSyntaxMigrateOnlySql92SaneDdlCommandSyntaxBeamDeserializersbeamArbitraryDeserializersBeamSerializedExpressionfromBeamSerializedExpressionBeamSerializedReferentialAction#fromBeamSerializedReferentialActionBeamSerializedMatchTypefromBeamSerializedMatchTypeBeamSerializedConstraintfromBeamSerializedConstraint"BeamSerializedConstraintAttributes&fromBeamSerializedConstraintAttributes"BeamSerializedConstraintDefinition&fromBeamSerializedConstraintDefinitionBeamSerializedDataTypefromBeamSerializedDataTypebeamSerializeJSONserializePrecAndDecimalbeamDeserializeMaybebeamDeserializebeamDeserializersql92Deserializerssql99DataTypeDeserializers.sql2003BinaryAndVarBinaryDataTypeDeserializers"sql2008BigIntDataTypeDeserializers$fToJSONBeamSerializedDataType5$fIsSql2008BigIntDataTypeSyntaxBeamSerializedDataTypeA$fIsSql2003BinaryAndVarBinaryDataTypeSyntaxBeamSerializedDataType-$fIsSql99DataTypeSyntaxBeamSerializedDataType-$fIsSql92DataTypeSyntaxBeamSerializedDataTypeE$fIsSql92ConstraintAttributesSyntaxBeamSerializedConstraintAttributesK$fIsSql92ColumnConstraintDefinitionSyntaxBeamSerializedConstraintDefinition/$fIsSql92MatchTypeSyntaxBeamSerializedMatchType?$fIsSql92ReferentialActionSyntaxBeamSerializedReferentialAction7$fIsSql92ColumnConstraintSyntaxBeamSerializedConstraint#$fGCompareTYPEBeamDeserializerLabel$fGEqTYPEBeamDeserializerLabel$fMonoidBeamDeserializers$fSemigroupBeamDeserializers$fMonoidBeamDeserializer$fSemigroupBeamDeserializer$fShowBeamSerializedDataType$fEqBeamSerializedDataType($fShowBeamSerializedConstraintDefinition&$fEqBeamSerializedConstraintDefinition($fShowBeamSerializedConstraintAttributes&$fEqBeamSerializedConstraintAttributes*$fMonoidBeamSerializedConstraintAttributes-$fSemigroupBeamSerializedConstraintAttributes$fShowBeamSerializedConstraint$fEqBeamSerializedConstraint$fShowBeamSerializedMatchType$fEqBeamSerializedMatchType%$fShowBeamSerializedReferentialAction#$fEqBeamSerializedReferentialAction$fShowBeamSerializedExpression$fEqBeamSerializedExpressionHsNoneHsModule hsModuleNamehsModuleEntitieshsModuleMigrationHsTableConstraintDeclshsTableConstraintInstancehsTableConstraintDeclsHsTableConstraint HsFieldLookup hsFieldLookupHsEntityhsEntityBackendhsEntitySyntax hsEntityName hsEntityDeclshsEntityDbDecl hsEntityExp HsBeamBackendHsBeamBackendSingleHsBeamBackendConstrainedHsBeamBackendNoneHsBackendConstraintbuildHsBackendConstraintHsActionhsSyntaxMigrationhsSyntaxEntitiesHsDecl hsDeclSyntax hsDeclImports hsDeclExportsHsColumnSchemamkHsColumnSchemahsColumnSchemaTypeHsExpr hsExprSyntax hsExprImportshsExprConstraintshsExprTypeVariablesHsType hsTypeSyntax hsTypeImports HsDataTypehsDataTypeMigrationhsDataTypeTypehsDataTypeSerialized HsImportsHsImport HsImportAll HsImportSome HsEntityNamegetHsEntityNameHsConstraintDefinition hsConstraintDefinitionConstraint HsDbFieldbuildHsDbField importSome importTyNamedimportVarNamedhsActionsToModuleunqualentityDbFieldName derivingDecldataDecl insDataDecldatabaseTypeDeclmigrationTypeDecl migrationDecl dbTypeDecldbDeclrenderHsSchema hsErrorTypetyParens functionTytyTupletyApp tyConNamed tyVarNamed combineHsExprhsApphsVisibleTyApphsApApphsStrhsRecConhsMaybehsVar hsVarFromhsTyConhsInthsOp hsInstancehsDerivingInstancehsListhsTupleinstsql92SaneDdlCommandSyntax $fHashableSet$fHashableMaybePromotedName$fHashableDerivStrategy$fHashableCName$fHashableNamespace$fHashableImportSpec$fHashableBangType$fHashableGuardedRhs$fHashableRole$fHashableBooleanFormula$fHashableAnnotation$fHashableRuleVar$fHashableActivation$fHashableRule$fHashableSafety$fHashableCallConv$fHashablePatternSynDirection$fHashableMatch $fHashableOp$fHashableAssoc$fHashableInstDecl$fHashableOverlap$fHashableClassDecl$fHashableFunDep$fHashableInstHead$fHashableGadtDecl$fHashableFieldDecl$fHashableInstRule$fHashableDeriving$fHashableConDecl$fHashableXAttr$fHashableQualConDecl$fHashableBracket$fHashableDataOrNew$fHashableQualStmt$fHashableTypeEqn$fHashableFieldUpdate $fHashableRhs$fHashablePXAttr$fHashableInjectivityInfo$fHashableUnpackedness $fHashableAlt$fHashableResultSig$fHashableXName$fHashableRPatOp$fHashableStmt$fHashableRPat$fHashableIPBind$fHashableDeclHead$fHashableDecl$fHashablePatField$fHashableSplice$fHashableBinds$fHashablePromoted$fHashableBoxed$fHashableSign $fHashablePat$fHashableSpecialCon$fHashableContext$fHashableKind$fHashableTyVarBind $fHashableQOp$fHashableType$fHashableName$fHashableLiteral$fHashableAsst$fHashableIPName$fHashableModuleName$fHashableQName $fHashableExp$fMonoidHsImport$fSemigroupHsImport$fHashableHsImport$fMonoidHsImports$fSemigroupHsImports$fHashableHsImports$fHashableHsType$fIsSql92FieldNameSyntaxHsExpr$fHasSqlValueSyntaxHsExprBool$fHasSqlValueSyntaxHsExprInt$fIsSql92QuantifierSyntaxHsExpr$fHashableHsExpr+$fSql92SerializableDataTypeSyntaxHsDataType)$fIsSql2008BigIntDataTypeSyntaxHsDataType5$fIsSql2003BinaryAndVarBinaryDataTypeSyntaxHsDataType!$fIsSql99DataTypeSyntaxHsDataType!$fIsSql92DataTypeSyntaxHsDataType$fIsSql92ExpressionSyntaxHsExpr$fSql92DisplaySyntaxHsDataType$fHashableHsDataTypeC$fSql92SerializableConstraintDefinitionSyntaxHsConstraintDefinition*$fSql92DisplaySyntaxHsConstraintDefinition $fHashableHsConstraintDefinition)$fIsSql92ColumnSchemaSyntaxHsColumnSchema"$fSql92DisplaySyntaxHsColumnSchema$fHashableHsColumnSchema$fEqHsColumnSchema$fShowHsColumnSchema$fMonoidHsBeamBackend$fSemigroupHsBeamBackend $fIsSql92DropTableSyntaxHsAction!$fIsSql92DdlCommandSyntaxHsAction$fMonoidHsAction$fSemigroupHsAction$fMonoidHsTableConstraintDecls!$fSemigroupHsTableConstraintDecls/$fIsSql92TableConstraintSyntaxHsTableConstraint)$fIsSql92ConstraintAttributesSyntaxHsNone%$fIsSql92ColumnConstraintSyntaxHsExpr&$fIsSql92ReferentialActionSyntaxHsNone$fIsSql92MatchTypeSyntaxHsNone?$fIsSql92ColumnConstraintDefinitionSyntaxHsConstraintDefinition"$fIsSql92CreateTableSyntaxHsAction&$fIsSql92AlterColumnActionSyntaxHsNone%$fIsSql92AlterTableActionSyntaxHsNone!$fIsSql92AlterTableSyntaxHsAction$fMonoidHsNone$fSemigroupHsNone$fHashableHsNone$fShowHsEntityName$fEqHsEntityName$fOrdHsEntityName$fIsStringHsEntityName$fShowHsImport $fEqHsImport$fGenericHsImport$fShowHsImports $fEqHsImports $fShowHsType $fEqHsType$fGenericHsType $fShowHsExpr $fEqHsExpr$fGenericHsExpr$fEqHsDataType$fShowHsDataType$fGenericHsDataType$fShowHsConstraintDefinition$fEqHsConstraintDefinition$fGenericHsConstraintDefinition $fShowHsNone $fEqHsNone $fOrdHsNone$fGenericHsNone FieldCheck DomainCheck TableCheckPredicateSpecificityPredicateSpecificityOnlyBackendPredicateSpecificityAllBackendsSomeDatabasePredicateDatabasePredicateenglishDescriptionpredicateSpecificityserializePredicatepredicateCascadesDropOnpDataType FieldSchemaTableFieldSchema TableSchemaTableHasPrimaryKeyhasPrimaryKey_tablehasPrimaryKey_colsTableColumnHasConstrainthasConstraint_tablehasConstraint_columnhasConstraint_defnTableHasColumnhasColumn_tablehasColumn_columnhasColumn_typeTableExistsPredicatebeamCheckDeserializers'$fDatabasePredicateTableExistsPredicate$fHashableTableExistsPredicate!$fDatabasePredicateTableHasColumn$fEqTableHasColumn$fHashableTableHasColumn+$fDatabasePredicateTableColumnHasConstraint"$fHashableTableColumnHasConstraint%$fDatabasePredicateTableHasPrimaryKey$fHashableTableHasPrimaryKey$fShowTableExistsPredicate$fEqTableExistsPredicate$fOrdTableExistsPredicate$fGenericTableExistsPredicate!$fGenericTableColumnHasConstraint$fShowTableHasPrimaryKey$fEqTableHasPrimaryKey$fGenericTableHasPrimaryKey$fEqTableColumnHasConstraintSql92HasDefaultDataTypeHasDefaultSqlDataTypedefaultSqlDataType HasDefaultSqlDataTypeConstraintsdefaultSqlDataTypeConstraintsCheckedFieldModificationCheckedDatabaseSettingsCheckedDatabaseEntityIsCheckedDatabaseEntityCheckedDatabaseEntityDescriptor(CheckedDatabaseEntityDefaultRequirementsunCheckcollectEntityCheckscheckedDbEntityAutounCheckDatabase collectCheckscheckedFieldNamedmodifyCheckedTablecheckedTableModificationMigrationCommandmigrationCommand migrationCommandDataLossPossibleMigrationDataLossMigrationLosesDataMigrationKeepsData Migration MigrationFMigrationRunCommand_migrationUpCommand_migrationDownCommand_migrationNextMigrationSteps MigrationSteprunMigrationStepsrunMigrationSilencederaseMigrationType migrationStepupDown migrateScriptexecuteMigrationmigrationDataLossevaluateDatabase stepNames$fMonoidMigrationDataLoss$fSemigroupMigrationDataLoss$fCategoryMigrationSteps$fArrowMigrationSteps$fShowMigrationDataLoss$fShowMigrationCommand$fFunctorMigrationF$fFunctorMigrationStepFieldReturnTypefield' Constraint DefaultValueTableMigrationColumnMigrationcolumnMigrationFieldNamecolumnMigrationFieldChecks createTable dropTablepreserve renameTableTorenameColumnTo dropColumn addColumn alterTablefield defaultTo_notNulluniqueintsmallintbigintbinary varbinarydatecharvarchardoublenumeric timestamptz timestamptimebooleancharacterLargeObjectbinaryLargeObjectarray maybeTypeF$fFieldReturnTypedefaultGivencollationGivensyntaxresTyTableFieldSchema8$fFieldReturnTypedefaultGivencollationGivensyntaxresTy->0$fFieldReturnTypeTruecollationGivensyntaxresTy->9$fFieldReturnTypedefaultGivencollationGivensyntaxresTy->01$fFieldReturnTypeFalsecollationGivensyntaxresTy->9$fFieldReturnTypedefaultGivencollationGivensyntaxresTy->1$fMonadTableMigration$fApplicativeTableMigration$fFunctorTableMigrationIsBeamSerialColumnSchemaSyntax genericSerialSqlConstraintAttributesBuilder_sqlConstraintAttributeTiming!_sqlConstraintAttributeDeferrableConstraintAttributeTimingInitiallyDeferredInitiallyImmediate"SqlSyntaxBuilderCreateTableOptionsfromSqlConstraintAttributes!sqlConstraintAttributesSerialized$$fSql92DisplaySyntaxSqlSyntaxBuilder0$fIsSql92ReferentialActionSyntaxSqlSyntaxBuilder($fIsSql92MatchTypeSyntaxSqlSyntaxBuilder/$fIsSql92ColumnConstraintSyntaxSqlSyntaxBuilder+$fIsSql92ColumnSchemaSyntaxSqlSyntaxBuilder.$fIsSql92TableConstraintSyntaxSqlSyntaxBuilder0$fIsSql92AlterColumnActionSyntaxSqlSyntaxBuilder/$fIsSql92AlterTableActionSyntaxSqlSyntaxBuilder)$fIsSql92AlterTableSyntaxSqlSyntaxBuilder($fIsSql92DropTableSyntaxSqlSyntaxBuilder)$fIsSql92DdlCommandSyntaxSqlSyntaxBuilder*$fIsSql92CreateTableSyntaxSqlSyntaxBuilder9$fIsSql92ColumnConstraintDefinitionSyntaxSqlSyntaxBuilderA$fIsSql92ConstraintAttributesSyntaxSqlConstraintAttributesBuilder&$fMonoidSqlConstraintAttributesBuilder)$fSemigroupSqlConstraintAttributesBuilder&$fEqSqlSyntaxBuilderCreateTableOptions$fShowConstraintAttributeTiming$fEqConstraintAttributeTiming$fOrdConstraintAttributeTiming$fEnumConstraintAttributeTiming"$fBoundedConstraintAttributeTiming$$fShowSqlConstraintAttributesBuilder"$fEqSqlConstraintAttributesBuilderdefaultMigratableDbSettings FinalSolutionSolved CandidatesSolverProvideSolution SearchFailed ChooseActionschoosingActionsAtStategetPotentialActionChoicepotentialActionChoicescontinueSearchActionProvidergetPotentialActionsActionProviderFnPotentialActionactionPreConditionsactionPostConditionsactionCommands actionEnglish actionScore DatabaseStatedbStateCurrentState dbStateKeydbStateCmdSequenceDatabaseStateSourceDatabaseStateSourceOriginalDatabaseStateSourceDerived ensuringNot_justOne_createTableActionProviderdropTableActionProvideraddColumnProvideraddColumnNullProviderdropColumnNullProviderdefaultActionProvider finalSolutionheuristicSolver$fNFDataDatabaseStateSource$fNFDataDatabaseState$fOrdMeasuredDatabaseState$fEqMeasuredDatabaseState$fNFDataMeasuredDatabaseState$fMonoidPotentialAction$fSemigroupPotentialAction$fMonoidActionProvider$fSemigroupActionProvider$fShowDatabaseStateSource$fEqDatabaseStateSource$fOrdDatabaseStateSource$fEnumDatabaseStateSource$fBoundedDatabaseStateSource$fGenericDatabaseStateSource$fShowDatabaseState$fShowMeasuredDatabaseState$fGenericMeasuredDatabaseState$fShowFinalSolutionHaskellPredicateConverterSomeBeamMigrationBackendBeamMigrationBackend backendNamebackendConnStringExplanationbackendRenderStepsbackendGetDbConstraintsbackendPredicateParsersbackendRenderSyntaxbackendFileExtensionbackendConvertToHaskellbackendActionProviderbackendTransactDdlErrorsql92HsPredicateConvertershasColumnConvertertrivialHsConverterhsPredicateConverter!$fMonoidHaskellPredicateConverter$$fSemigroupHaskellPredicateConverter BeamMigrateDb_beamMigrateVersionTbl_beamMigrateLogEntriesBeamMigrateVersionKeyBeamMigrateVersionBeamMigrateVersionT_beamMigrateVersion LogEntryKeyLogEntry LogEntryT _logEntryId_logEntryCommitId _logEntryDatebeamMigratableDb beamMigrateDbbeamMigrateDbMigrationbeamMigrateSchemaVersiongetLatestLogEntryupdateSchemaToCurrent recordCommitensureBackendTablescheckForBackendTables$fBeamablePrimaryKey$fTableLogEntryT$fBeamableLogEntryT$fBeamablePrimaryKey0$fTableBeamMigrateVersionT$fBeamableBeamMigrateVersionT$fDatabasebeBeamMigrateDb$fGenericPrimaryKey$fGenericPrimaryKey0$fGenericLogEntryT$fGenericBeamMigrateVersionT$fGenericBeamMigrateDb$fShowPrimaryKey$fShowBeamMigrateVersionT$fShowPrimaryKey0$fShowLogEntryTVerificationResultVerificationSucceededVerificationFailedBringUpToDateHooksrunIrreversibleHook startStepHook endStepHookrunCommandHookqueryFailedHookdiscontinuousMigrationsHooklogMismatchHookdatabaseAheadHookdefaultUpToDateHooks bringUpToDatebringUpToDateWithHooks simpleSchema createSchema autoMigratesimpleMigration verifySchemarunSimpleMigrationbackendMigrationScript haskellSchema$fShowVerificationResult(beam-core-0.7.2.3-9p4aPiEXZUoEyYCUyIaZpjDatabase.Beam.Backend.SQL.SQL92IsSql92DataTypeSyntaxbaseGHC.BaseString$aeson-1.4.2.0-AJSJFErvuVt75VMZs4WuOEData.Aeson.Types.InternalValueIsSql92ExpressionSyntax decimalType GHC.MaybeMaybeDatabase.Beam.Backend.SQL.SQL99IsSql99DataTypeSyntax!Database.Beam.Backend.SQL.SQL2003)IsSql2003BinaryAndVarBinaryDataTypeSyntaxIsSql2008BigIntDataTypeSyntax'hashable-1.2.7.0-2SI038axTEd7AEZJ275kpiData.Hashable.ClassHashableghc-prim GHC.ClassesEq GHC.TypesTrueFalse IsSql92SyntaxGMigratableTableSettingsgDefaultTblSettingsChecks Data.StringIsStringDatabase.Beam.Schema.TablesDatabaseSettingsDatabaseEntityIsDatabaseEntityDatabaseEntityDescriptor!DatabaseEntityDefaultRequirements dbEntityAutoCheckedDatabaseDomainTypeCheckedDatabaseTableNothingDatabase.Beam.Query.InternalQExprbytestring-0.10.8.2 Data.ByteString.Builder.InternalBuilderGAutoMigratableDbdefaultMigratableDbSettings'MeasuredDatabaseStatedropColumnProvider solvedStatemempty PrimaryKeyfailJust