.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH I J K L M N O P Q R S T U 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 { | } ~                        None+3  Column nameError description     Safe-Inferred  !"#$%&'(#$%&'(  !"#$%&'( Trustworthy;)aNewer versions of GHC return an Int# instead of a Bool for primitive comparison functions. The cmpres9 function converts the result of such a comparison to a Bool.*Quote an identifier using unicode quoting syntax. This is necessary for identifiers containing a question mark, as otherwise PostgreSQL.SimpleQ's naive formatting code will attempt to match the question mark to a paremeter. <Build a quoted identifier. Generally you will want to use  1, and for repeated use it will be faster to use + .  >, but this internal function is exposed in case it is useful. ~Quote an identifier such as a table or column name using double-quote characters. Note this has nothing to do with quoting valuesV, which must be quoted using single quotes. (Anyway, all values should be quoted by , or r.) This function uses a unicode escape sequence to escape '?' characters, which would otherwise be expanded by ,, -, or .+S8.putStrLn $ quoteIdent "hello \"world\"!""hello ""world""!"+S8.putStrLn $ quoteIdent "hello \"world\"?" U&"hello ""world""\003f"4Note that this quoting function is correct only if client_encoding is  SQL_ASCII,  client_coding is UTF8^, or the identifier contains no multi-byte characters. For other coding schemes, this function may erroneously duplicate bytes that look like quote characters but are actually part of a multi-byte character code. In such cases, maliciously crafted identifiers will, even after quoting, allow injection of arbitrary SQL commands to the server.The upshot is that it is unwise to use this function on identifiers provided by untrustworthy sources. Note this is true anyway, regardless of client_encoding8 setting, because certain "system column" names (e.g., oid, tableoid, xmin, cmin, xmax, cmax, ctidF) are likely to produce unexpected results even when properly quoted.See IdH for a convenient way to include quoted identifiers in parameter lists..<Bad things will happen if the argument is greater than 0xff.A lower-level function used by  and 0. You probably don't need to call it directly.A builder version of , possibly useful if you are about to concatenate various individually formatted query fragments and want to save the work of concatenating each individually.Take a SQL template containing '?' characters and a list of paremeters whose length must match the number of '?' characters, and format the result as an escaped / that can be used as a query.Like -, this function is naive about the placement of '?' characters and will expand all of them, even ones within quotes. To avoid this, you must use  + on identifiers containing question marks. Also like -, '?' characters touching other '?' characters or quoted strings may do the wrong thing, and end up doubling a quote, so avoid substrings such as "??" or "?string"), as these could get expanded to, e.g., "'param ''string'"[, which is a single string containing an apostrophe, when you probably wanted two strings.)012345* 6.7 8    )012345* 6.7 8NoneCreates a PostgreSQL 9 using the  DATABASE_URLM environment variable, if it exists. If it does, it should match the format: = postgresql://[[USERNAME@PASSWORD]HOSTNAME[:PORT]]/[DBNAME] 0If it is not present, the environment variables  PG_DBNAME PG_HOST etc, are used.PRuns the SQL file at the given path, relative to the current working directory.3Returns a column defition by quoting the given nameCreates a table. See " for constructing the column list. Returns a :# that creates a table, for example: a create_table "posts" [ column "title" "VARCHAR(255) NOT NULL" , column "body" "text"]  Drops a table Returns a : that drops a table.Adds a column to the given table. For example, , add_column "posts" "title" "VARCHAR(255)" :adds a varchar column called "title" to the table "posts". Returns a :4 that adds a column to the given table. For example, , add_column "posts" "title" "VARCHAR(255)" Returns the query 0 ALTER TABLE "posts" add "title" VARCHAR(255); 1Drops a column from the given table. For example,  drop_column "posts" "title" 0drops the column "title" from the "posts" table. Returns a :7 that drops a column from the given table. For example,  drop_column "posts" "title" Returns the query # ALTER TABLE "posts" add "title"; 1Renames a column in the given table. For example, ' rename_column "posts" "title" "name" :renames the column "title" in the "posts" table to "name".! Returns a :7 that renames a column in the given table. For example, ' rename_column "posts" "title" "name" Returns the query 0 ALTER TABLE "posts" RENAME "title" TO "name"; "0Alters a column in the given table. For example, / change_column "posts" "title" "DROP DEFAULT" Jdrops the default constraint for the "title" column in the "posts" table.# Returns a :6 that alters a column in the given table. For example, / change_column "posts" "title" "DROP DEFAULT" Returns the query 2 ALTER TABLE "posts" ALTER "title" DROP DEFAULT; $&Creates an index for efficient lookup.%,Creates a unique index for efficient lookup.& Returns a :N that creates an index for the given columns on the given table. For example, 7 create_index_stmt "post_owner_index" "posts" "owner" Returns the query 7 CREATE INDEX "post_owner_index" ON "posts" ("owner") 'Drops an index.( Returns a : that drops an index. % drop_index_stmt "post_owner_index" Returns the query  DROP INDEX "post_owner_index" ;<=>?@nametype, definition, constraints Table nameColumn definitions Table nameColumn definitions Table name Column nameColumn definition Table name Column nameColumn definition Table name Column name Table name Column name  Table nameOld column nameNew column name! Table nameOld column nameNew column name" Table name Column nameAction# Table name Column nameAction$ Index name Table name Column names% Index name Table name Column names& Unique index? Index name Table name Column names' Index name( Index nameA)Migration functionRollback function !"#$%&'())$%' "&(!#;<=>?@ !"#$%&'(A)None/1The default relative path containing migrations: "db/migrations"03Dumps the database schema to the given file handle.%This is a wrapper around the utility pg_dump) that comes with postgresql. Therefore, pg_dump! must be installed on the system.1wInitializes the database by creating a "schema-migrations" table. This table must exist before running any migrations.2Runs all new migrations in a given directory and dumps the resulting schema to a file "schema.sql" in the migrations directory.eDetermining which migrations to run is done by querying the database for the largest version in the schema_migrationsQ table, and choosing all migrations in the given directory with higher versions.BYRun a migration. The returned exit code denotes the success or failure of the migration.CYRun a migration. The returned exit code denotes the success or failure of the migration.*+,-./012Log output (probably stdout)'Path to directory containing migrationsB3CDEF4 *+,-./01234 12304/*+,-. *+,-./012B3CDEF4None7Internal column number used by PostgreSQL. Generally these will be consecutive starting from 1, but this may not be the case if you have altered a table to delete columns.8Name of the column9Type of the column:If GR, the database cannot contain null. (This constraint should always be accurate.);GZ if this column (and only this column) constitutes the primary key of the table. Always HX if the primary key comprises multiple columns (even if this is one of those columns).<G: if there is a uniqueness constraint on this column. Not G if this column is part of a uniqueness constraint involving multiple columns. (Such multi-column uniqueness constraints are not reported by this interface.)=If this there is a foreign key constraint on this column (and the constraint does not span multiple columns), report the table referenced by this column.>Returns a list of 5 structures for a particular table. Not all information about a table is returned. In particular, constraints that span columns are ignored. 56789:;<=I> 56789:;<=> 56789:;<=>56789:;<=I>None?;Set configuration parameters on a database by editing the postgresql.conf4 file. Takes the database directory and a list of ( parameter,  full-line)o pairs. For example, when creating a throw-away database cluster you later intend to discard, you might say: /configLocalDB dbpath [("fsync", "fsync = off")]iNote that the second element of each pair is the complete configuration line. It is not correct to say: 6configLocalDB dbpath [("fsync", "off")] -- INCORRECT@Create a directory for a local database cluster entirely self-contained within one directory. This is accomplished by creating a new PostgreSQL database cluster in the directory and setting the following configuration options in postgresql.conf:listen_address is set to empty (i.e., ''f), so that no TCP socket is bound, avoiding conflicts with any other running instaces of PostgreSQL.logging_collector is set to yes., so that all message logs are kept in the pg_log- subdirectory of the directory you specified.Note this function does notm start a postgres server after creating the directory. You will seperately need to start the server using A or B. (And note that B already calls  createLocalDBo if the directory does not exist or is empty. Hence the primary use of this function is if you want to call ? between @ and A.)AeStart a local database if the server is not already running. Otherwise, does nothing, but returns a Jg in either case. The database server will continue running after the current process exits (but see C).BA combination of @ and A.The parameter is a PostgreSQL data directory. If the directory is empty or does not exist, this function creates a new database cluster (via @w). Then, if a database server is not already running for the directory, starts a server. No matter what, returns a JA that will connect to the server running on this local database. Note that if  initLocalDBd starts a postgres server, the server process will continue running after the process that called  initLocalDB exits. This is normally fine. Since multiple client processes may access the same PostgreSQL database, it makes sense for the first client to start the database and no one to stop it. See Cq if you wish to stop the server process (which you should always do before deleting a test cluster). See also EI to create a temporary cluster for the purposes of running a test suite.CStop the server for a local database cluster entirely self-contained within one directory. You must call this before deleting the directory, or else stray postgres processes will linger forever. If the argument is the empty string, looks for the database directory in the PGDATA environment variable.DSet environment variables to make a local database cluster the default. Also returns shell commands you can eval or cut-and-paste into your shell to make pg_ctl and psql" access a local database cluster.ERun a function with a completely fresh database cluster that gets deleted on return. Since the entire database is blown away when the function returns,  withTempDB+ is obviously only useful for test suites.F\Reset a connection to its default state before re-cycling it for another thread or request.KL?MNO@PABCDEF?@ABCDEF@?ABCDEFKL?MNO@PABCDEF Safe-Inferred24GiThe point of this class is to ensure that you are using data types defined with record selectors (i.e.,  data Foo = Foo { unFoo :: Int } as opposed to data Foo = Foo Int).Unfortunately,  GHC.Generics makes the Q type a member of the R- class. Hence, if you want to ensure a type a is not Q, use the context (RequireSelector a) =>.)If you see a compilation error involving RequireSelector or IntentionallyCauseErrorT, it means you failed to define one of your datatypes using record selector syntax.SnThere are intentionally no members of this class, so that placing it in a context will always cause an error.GSTUGGGSTU None +01234BJKMQHA newtype wrapper in the Vi class, which marshalls every field except the primary key, followed by the primary key. For use with c.JA newtype wrapper in the VK class, which marshalls every field except the primary key. For use with d.LA newtype wrapper in the WM class, permitting every model to be used as the result of a database query.O The newtype As can be wrapped around an existing type to give it a table name alias in a query. This is necessary when a model is being joined with itself, to distinguish the two joined instances of the same table. For example:#@{-# LANGUAGE OverloadedStrings #-}data X = X instance R! X where rowAliasName = const "x" ... r <- dbSelect] c $ addWhere_ "bar.bar_key = x.bar_parent" modelDBSelect :: IO [Bar :. As X Bar] @R2The class of types that can be used as tags in as O alias. Such types should be unit types--in other words, have exactly one constructor where the constructor is nullary (take no arguments). The reason for this class is that the T instance for O requires a way to extract the name of the row alias without having a concrete instance of the type. This is provided by the S# method (which must be non-strict).SReturn the SQL identifier for the row alias. This method must be non-strict in its argument. Hence, it should discard the argument and return the name of the alias. For example: y{-# LANGUAGE OverloadedStrings #-} data My_alias = My_alias instance RowAlias My_alias where rowAliasName _ = "my_alias"uKeep in mind that PostgreSQL folds unquoted identifiers to lower-case. However, this library quotes row aliases in SELECTP statements, thereby preserving case. Hence, if you want to call construct a WHERE4 clause without double-quoting row aliases in your :2, you should avoid capital letters in alias names.A default implementation of  rowAliasNameD exists for unit types (as well as empty data declarations) in the Xk class. The default converts the first character of the type name to lower-case, following the logic of .Y5AnyField parses (simply by consuming) any SQL column.TThe class of data types that represent a database table. This class conveys information necessary to move a Haskell data structure in and out of a database table. The most important field is U9, which describes the database table and column names. UL has a reasonable default implementation for types that are members of the X class (using GHC's  DeriveGeneric4 extension), provided the following conditions hold: `The data type must have a single constructor that is defined using record selector syntax.0The very first field of the data type must be a X to represent the primary key. Other orders will cause a compilation error.?Every field of the data structure must be an instance of Z and [.[If these three conditions hold and your database naming scheme follows the conventions of --namely that the table name is the same as the type name with the first character downcased, and the field names are the same as the column names--then it is reasonable to have a completely empty (default) instance declaration:  data MyType = MyType { myKey :: !DBKey , myName :: !S.ByteString , myCamelCase :: !Int , ... } deriving (Show, Generic) instance Model MyType The default U method is called . You may wish to use almost all of the defaults, but tweak a few things. This is easily accomplished by overriding a few fields of the default structure. For example, suppose your database columns use exactly the same name as your Haskell field names, but the name of your database table is not the same as the name of the Haskell data type. You can override the database table name (field u ) as follows: [ instance Model MyType where modelInfo = defaultModelInfo { modelTable = "my_type" }5Finally, if you dislike the conventions followed by H, you can simply implement an alternate pattern. An example of this is n, which strips a prefix off every field name and converts everything from camel-case to underscore notation: H instance Model MyType where modelInfo = underscoreModelInfo "my"The above code will associate MyType with a database table my_type having column names key, name,  camel_case, etc.&You can implement other patterns like  by calling h and modifying the results. Alternatively, you can directly call the lower-level functions from which  is built (, , ).U modelInfoc provides information about how the Haskell data type is stored in the database, in the form of a s data structure. Among other things, this structure specifies the name of the database table, the names of the database columns corresponding to the Haskell data structure fields, and the position of the primary key in both the database columns and the Haskell data structure.VV contains the table and column names verbatim as they should be inserted into SQL queries. For normal models, these are simply double-quoted (with  ) versions of the names in U~, with the column names qualified by the double-quoted table name. However, for special cases such as join relations (with ) or row aliases (with O), VC can modify the table name with unquoted SQL identifiers (such as JOIN and AS7) and change the qualified column names appropriately.W modelRead converts from a database ,) result to the Haskell data type of the Model , namely a. Note that if type a is an instance of W, a fine definition of  modelRead is modelRead = fromRow7. The default is to construct a row parser using the Xf class. However, it is crucial that the columns be parsed in the same order they are listed in the v field of a's sq structure, and this should generally be the same order they are defined in the Haskell data structure. Hence  modelRead should generally look like:  -- Call \N as many times as there are fields in your type modelRead = Constructor <$> \ <*> \ <*> \ XMarshal all fields of a except the primary key. As with W[, the fields must be marshalled in the same order the corresponding columns are listed in v:, only with the primary key (generally column 0) deleted.Do not define this as ] , even if a is an instance of V , because ]/ would include the primary key. Similarly, do not define this as ,. On the other hand, it is reasonable for  modelWriteP to return an error for degenerate models (such as joins) that should never be d.Y modelQueries provides pre-formatted : templates for , , and . The default Y value is generated from V[ and should not be modified. However, for degenerate tables (such as joins created with ), it is reasonable to make Yu always throw an exception, thereby disallowing ordinary queries and requiring use of more general query functions.PThis method should either throw an exception or use the default implementation.Z)Extra constraints, if any, to place in a  CREATE TABLE statement. Only used by #Database.PostgreSQL.ORM.CreateTable.[JPerform a validation of the model, returning any errors if it is invalid.\Extra information for #Database.PostgreSQL.ORM.CreateTable(. You probably don't need to use this.^PA list of (column-name, type) pairs for which you want to override the default._-Extra constraints to stick at the end of the  CREATE TABLE statement.`=Standard CRUD (create/read/update/delete) queries on a model.bjA query template for looking up a model by its primary key. Expects a single query parameter, namely the  or | being looked up.c*A query template for updating an existing TW in the database. Expects as query parameters a value for every column of the model except the primary key, followed by the primary key. (The primary key is not written to the database, just used to select the row to change.)d%A query template for inserting a new TC in the database. The query parameters are values for all columns except the primary key. The query returns the full row as stored in the database (including the values of fields, such as the primary key, that have been chosen by the database server).e A query template for deleting a TF from the database. Should have a single query parameter, namely the  of the row to delete.fSQL table and column identifiers that should be copied verbatim into queries. For normal models, these will simply be quoted versions of the fields in the corresponding sa. However, for special cases, the fields of this structure can contain unquoted SQL including JOIN9 keywords. In the case of joins, different elements of i, may be qualified by different table names. Note that i and j, both contain table-qualified names (e.g., "\"my_type\".\"key\"" ), while k' contains only the quoted column names.h&Literal SQL for the name of the table.i-Literal SQL for each, table-qualified column.j@Literal SQL for the model's table-qualified primary key column.kmLiteral SQL for all the columns except the primary key. These are the columns that should be included in an INSERT or UPDATEA. Note that unlike the other fields, these column names should not be table-qualified.lWhen all columns in i< are qualified by the same table name, this field contains ^ the table name. For the W type (in which different columns have different table qualifications), this field is _.4For normal models, this field will be identical to h. However, for O models, h$ will contain unquoted SQL such as "\"MyType\" AS \"my_alias\"", in which case modelQualifier will contain ^ "\"my_alias\"".m{The original, unquoted name of the table representing the model in the database. Ordinarily, this should be the same as u in s, but in the case of O aliases, the u is an alias, and m is the original table. _ for joins.pSThis class extracts the first field in a data structure when the field is of type H. If you get a compilation error because of this class, then move the  first in your data structure.qThis class extracts the field names of a Haskell data structure. Only defined for types with a single constructor that uses record syntax.r*This class returns the name of a datatype.sA  ModelInfo T1 contains the information necessary for mapping T to a database table. Each T type has a single  ModelInfo, associated with it, accessible through the U method of the T{ class. Note the table and column names must all be unquoted in this data structure, as they will later be quoted using   by the V method.uIThe name of the database table corresponding to this model. The default U instance uses H, which is the name of your data type with the first letter downcased.vThe names of the database columns corresponding to fields of this model. The column names should appear in the order in which the fields are defined in the Haskell data type a+ (which should also be the order in which W parses them to an a and X marshalls them).Note that all queries generated by the library specify explicit column names. Hence the order of columns does not need to match their order in the database table. They should instead match the order of fields in the Haskell data structure.The default, given by ), is to use the Haskell field names for a). This default will fail to compile if a$ is not defined using record syntax.w0The 0-based index of the primary key column in vC. This should be 0 when your data structure's first field is its ' (highly recommended, and required by :). If you customize this field, you must also customize x0--no check is made that the two are consistent.xoReturn the primary key of a particular model instance. If you customize this field, you must also customize w0--no check is made that the two are consistent.yA  DBRefUnique TK represents a one-to-one relationship between types. For example, if type A contains a  DBRefUnique B , then each A* is associated with one (or at most one) B , and each B has one (or at most one) A associated with it.By contrast, a |' represents a many-to-one relationship.zPhantom type for instantiating ; that represents a one-to-one relationship between tables.|A DBRef TM represents a many-to-one relationship between tables. For example, if type A contains a DBRef B , then each B is associated with many A's. By contrast, a y' represents a one-to-one relationship.DBRef is a type alias of kind * -> * . The type DBRef T! references an instance of type T< by the primary key of its database row. The type argument T should be an instance of T.}Phantom type for instantiating < that represents a one-to-many relationship between tables."Many operations can take either a | or a y) (both of which consist internally of a S). Hence, these two types are just type aliases to a generalized reference type GDBRef, where GDBRef's first type argument, reftype7, is a phantom type denoting the flavor of reference (} or z).OThe type of the Haskell data structure field containing a model's primary key.Every T must have exactly one DBKey , and the DBKey must be the TX's very first field in the Haskel data type definition. (The ordering is enforced by , which, through use of the  DeriveGeneric< extension, fails to compile when the first field is not a DBKey.)Each Tu stored in the database should have a unique non-null primary key. However, the key is determined at the time the TC is inserted into the database. While you are constructing a new TI to insert, you will not have its key. Hence, you should use the value NullKey# to let the database chose the key.If you wish to store a T*'s primary key as a reference in another T, do not copy the  structure. Use  to convert the T*'s primary key to a foreign key reference.qA type large enough to hold database primary keys. Do not use this type directly in your data structures. Use  to hold a T's primary key and |0 to reference the primary key of another model.Returns G when a  is .+Create a reference to the primary key of a T, suitable for storing in a | or y field of a different T.rThe default name of the database table corresponding to a Haskell type. The default is the same as the type name with the first letter converted to lower-case. (The rationale is that Haskell requires types to start with a capital letter, but all-lower-case table names are easier to use in queries because PostgreSQL generally does not require them to be quoted.)4Returns the Haskell field names in a data structure. Extract the primary key of type  from a model when the b is the first element of the data structure. Fails to compile if the first field is not of type .This function provides a ` function for X& types, suitable as a default of the W? class. This module uses it as the default implementation of W.This function provides a ] function for X types that marshalls each field of the data type in the order in which it appears in the type definition. This function is not a suitable implementation of Xt (since it marshals the primary key, which is not supposed to be written). However, it is required internally by G, and exposed in the unlikely event it is of use to alternate generic X; functions. You probably don't want to call this function.aMRemoves a single element from the list at the position specified. (Internal)Returns a series of bbs serializing each field of a data structure (in the order of the Haskell datatype definition), exceptu the primary key, since the primary key should never be written to a database. Every field must be an instance of [.The default definition of U. See the documentation at T for more information. Sets uS to the name of the type with the first character converted to lower-case. Sets v5 to the names of the Haskell field selectors. Sets w to 04 and extracts the first field of the structure for xv. Will fail to compile unless the data structure is defined with record syntax and that its first field is of type .YNote that defaults for the individual fields are available in separate functions (e.g., w) with fewer class requirements in the context, in case you want to make piecemeal use of defaults. The default for w; is 0. If you overwrite that, you will need to overwrite x" as well (and likely vice versa). An alternate T3 pattern in which Haskell type and field names are converted from camel-case to underscore notation. The first argument is a prefix to be removed from field names (since Haskell requires field names to be unique across data types, while SQL allows the same column names to be used in different tables). For example: data Bar = Bar { barId :: !DBKey , barNameOfBar :: !String , barParent :: !(Maybe (DBRef Bar)) } deriving (Show, Generic) instance Model Bar where modelInfo = underscoreModelInfo "bar"would associate type Bar with a database table called bar with fields id,  name_of_bar, and parent.cPConvert a name from camel-case to underscore notation. I.e., names of the form  MSizeForm are changed to  MSize_From.  skipFirstH determines if the first character should be ignored in the conversion.The default simply quotes the U and v fields of s using  .%Default SQL lookup query for a model.%Default SQL update query for a model.%Default SQL insert query for a model.%Default SQL delete query for a model.The default value of Y.A \9 that doesn't imply any extra constraints or exceptions.dDegenerate instances of T for types in the V class are to enable extra V types to be included with  in the result of dbSelect queries.fromAs extracts the row from an O alias row, but constrains the type of alias to be the same as its first argument (which is non-strict). This can save you from explicitly specifying types. For example: data X = X deriving (Generic) instance RowAlias X where rowAliasName = const "x" ... r <- map (\(b1 :. b2) -> (b1, fromAs X b2)) <$> dbSelect c $ addWhere \"bar.bar_key = x.bar_parent\" modelDBSelect%A type-restricted wrapper around the O+ constructor, under the same rationale as $. Not strict in its first argument. Lookup the u of a T (modelName _ = u (U :: s a)).Lookup the primary key of a T.Generate a SQL SELECT statement with no WHERE predicate. For example,  consists of modelSelectFragment followed by "WHERE  primary-key = ?".Dump an entire model. Useful for development and debugging only, as every row will be read into memory before the function returns.GNote that unlike the other primary model operations, it is OK to call # even on degenerate models such as O and . Follow a | or y4 and fetch the target row from the database into a T type r.Like  but instead of returning an e , throws a  if the T is invalid./ but returning '()' instead of the saved model.Write a T* to the database. If the primary key is , the item is written with an INSERTo query, read back from the database, and returned with its primary key filled in. If the primary key is not  , then the T is written with an UPDATE query and returned as-is.If the T& is invalid (i.e. the return value of [ is non-empty), a list of  InvalidError is returned instead.Remove the row corresponding to a particular data structure from the database. This function only looks at the primary key in the data structure. It is an error to call this function if the primary key is not set.9Remove a row from the database without fetching it first.$Print to stdout the query statement.fA degenerate instance of T# that re-names the row with a SQL ASd keyword. This is primarily useful when joining a model with itself. Hence, standard operations (, , ) are not allowed on O models.gCA degenerate instance of model representing a database join. The : instance does not allow normal model operations such as , , and ?. Attempts to use such functions will result in an exception.hEA degenerate model that lifts any model to a Maybe version. Returns _H on a parse failure. Useful, for example, for performing outer joins:  dbJoin modelDBSelect "LEFT OUTER JOIN" (addWhere 'foo = 123' $ modelDBSelect) "USING a.id = b.a_id" :: (A :. Maybe B) HIJKLMNOPQRSijYkTUVWXYZ[\]^_`abcdefghijklmnlompnqorpstuvwxyz{|}~acdqrstuvfwxyzg{h|}~\ HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\TUVWXYZ[stuvwxfghijklm`abcde|yLMNHIJKOPQRS }~z{\]^_pqronmHIJKLMNOPQRSijYkTUVWXYZ[\]^_`abcdefghijklmnlompnqorpstuvwxyz{|}~acdqrstuvfwxyzg{h|}~  Trustworthy 024JKM"+Datatype that represents a connected cursorA deconstructed SQL select statement that allows easier manipulation of individual terms. Several functions are provided to combine the , , and  clauses of muliple DBSelect structures. Other clauses may be discarded when combining queries with join operations. Hence it is advisable to set the other clauses at the end (or, if you set these fields, to collapse your " structure into a subquery using ). By default "SELECT"7, but might usefully be set to something else such as "SELECT DISTINCT" in some situations.Empty by default, but set to "WHERE" if any WHERE clauses are added to the  field.As it's name would suggest, a  FromClause% is the part of a query between the FROM keyword and the WHERE2 keyword. It can consist of simple table names, JOIN+ operations, and parenthesized subqueries.From clauses are represented in a more structured way than the other fields so as to allow the possibility of collapsing join relations. For instance, given a  (A :. B) and a  (B :. C),, it is desirable to be able to generate a  (A :. B :. C)( in which each pair of terms involving Bu in the three-way relation is constrained according to the original two queries. This functionality is provided by  and J, but it requires the ability to locate and replace the instance of type B in one  with the  FromClause of the other .The x field is a canonical name of each type, which by convention is the quoted and fully-qualified table name. Comparing  is somewhat of a hack, and happens entirely at runtime. It would be nicer to do this at compile time, but doing so would require language extensions such as GADTs of FunctionalDependencies.Usually "JOIN"ON or USING clause (or empty) Verbatim SQL for a table, table AS# alias, or parenthesized subquery.MCanonical name of the table or join relation represented by this term. For JOIN terms, this is always the  CROSS JOIN of the canonical names of  and Y. This means one can locate a join given only it's type (e.g., the canonical name for A :. B is always "a CROSS JOIN b"), but it does mean you have to be careful not accidentally to merge two different joins on the same types. For this reason it may be safest always to have type b be a single table in  and .A  structure with keyword "SELECT" and everything else empty.A i for one or more comma-separated expressions, rather than for a table. For example, to issue the query "SELECT lastval()": lastval :: DBSelect (Only DBKeyType) lastval = expressionDBSelect "lastval ()" ... [just_inserted_id] <- dbSelect conn lastvalIOn the other hand, for such a simple expression, you might as well call  directly. Create a  for a rendered version of a k. This can save one string copy if you want to embed one query inside another as a subquery, as done by d, and thus need to parenthesize it. However, the function is probably not a useful for end users.Turn a  into a : suitable for the , or  functions.!Add a where clause verbatim to a . The clause must not contain the WHERE+ keyword (which is added automatically by  addWhere_ if needed). If the DBSelect has existing WHERE+ clauses, the new clause is appended with AND. If the query contains any '?'z characters, they will be rendered into the query and matching parameters will later have to be filled in via a call to .WAdd a where clause, and pre-render parameters directly into the clause. The argument p0 must have exactly as many fields as there are '?' characters in the : . Example: rbars <- dbSelect c $ addWhere "bar_id = ?" (Only target_id) $ (modelDBSelect :: DBSelect Bar)Set the ORDER BY clause of a  . Example: ZdbSelect c $ setOrderBy "\"employeeName\" DESC NULLS FIRST" $ modelDBSelectSet the LIMIT clause of a .Set the OFFSET clause of a ./Add one or more comma-separated expressions to H that produce column values without any corresponding relation in the FROM clause. Type r` is the type into which the expression is to be parsed. Generally this will be an instance of W$ that is a degenerate model (e.g., , or a tuple).*For example, to rank results by the field value< and compute the fraction of overall value they contribute: r <- dbSelect c $ addExpression "rank() OVER (ORDER BY value), value::float4/SUM(value) OVER ()" modelDBSelect :: IO [Bar :. (Int, Double)]A " that returns all rows of a model.Run a % query on parameters. The number of '?'/ characters embedeed in various fields of the < must exactly match the number of fields in parameter type p1. Note the order of arguments is such that the g can be pre-rendered and the parameters supplied later. Hence, you should use this version when the ' is static. For dynamically modified  structures, you may prefer .Run a ' query and return the resulting models. Create a  for the given Fetch the next T for the underlying . If the cache has prefetched values, dbNext will return the head of the cache without querying the database. Otherwise, it will prefetch the next 256 values, return the first, and store the rest in the cache.Streams results of a A and consumes them using a left-fold. Uses default settings for  (batch size is 256 rows).Streams results of a I and consumes them using a monadic left-fold. Uses default settings for  (batch size is 256 rows).Streams results of a I and consumes them using a monadic left-fold. Uses default settings for  (batch size is 256 rows).Group the returned tuples by unique a's. Expects the query to return a's in sequence -- all rows with the same value for a must be grouped together, for example, by sorting the result on a's primary key column.Create a join of the , , and  clauses of two : queries. Other fields are simply taken from the second , meaning fields such as , , and  in the in the first  are entirely ignored. A version of  that uses  for the joined tables.DRestrict the fields returned by a DBSelect to be those of a single T a%. It only makes sense to do this if a is part of something_containing_aC, but no static check is performed that this is the case. If you  dbProject\ a type that doesn't make sense, you will get a runtime error from a failed database query.Like , but renders the entire input P as a subquery. Hence, you can no longer mention fields of models other than a that might be involved in joins. The two advantages of this approach are 1) that you can once again join to tables that were part of the original query without worrying about row aliases, and 2) that all terms of the  will be faithrully rendered into the subquery (whereas otherwise they could get dropped by join operations). Generally you will still want to use , but  dbProject' is available when needed.Nest two type-compatible JOIN queries. As with , fields of the first JOIN (the  (a :. b)) other than , , and  are entirely ignored.Like $, but projects away the middle type b.E First tableJoin keyword ("JOIN",  "LEFT JOIN", etc.) Second tablePredicate (if any) including ON or USING keyword Join keywordON or USING predicate56*  None24MThe class of Haskell types that can be converted to and from a particular SQL type. For most instances, you only need to define .7The name of the SQL type corresponding to Haskell type a, when a value of a9 can be null. This is the SQL type to and from which a  a will be converted (where _% corresponds to the SQL value null).7The name of the SQL type corresponding to Haskell type a, when a is not wrapped in  and hence cannot be null. If sqlType+ is unspecified, the default is to append "NOT NULL" to . Retreive the 9 corresponding to a type. You can subsequently use the  to call  getTypeInfo# for more information on the type.#  Safe 123468JK &An extractor that matches either type r or type Maybe r", and, in the former case, wraps Just/ around the value so as always to return type Maybe r..An extractor that matches an exact field type."Extract the single field matching  f r from a X data structure a with exactly one constructor.;Extract the 0-based position of the single field matching  f r within X data structure a . Non-strict in both arguments.(Generlized extraction of a field from a X data structure. Argument rep should generally be the type  t for some data type t$ whose fields you want to extract. r9 is the result type you want back from the extraction. f6 should be defined such that there is an instance of  f a r THasOne for each type a you want to convert to r and extract..Returns zero, one, or multiple values of type f wrapped in , , or  respectively.Returns (total, positions) where totalG is the total number of fields (matching or not) in the structure and  positionsL is a list of zero-based field numbers of the fields matching target type f r.(Class of types used as tag arguments to  and . f# should be a new unit type of kind * -> *p, used to designate the type of extraction you want. Then instances should be defined to transform each type a# you want to extract to some type r, with g set to . For example,  is a type to convert types a and Maybe a both to type Maybe a (i.e., type argument r is Maybe a). data ExtractMaybe a = ExtractMaybe instance Extractor ExtractMaybe a (Maybe a) THasOne where extract _ = THasOne . Just instance Extractor ExtractMaybe (Maybe a) (Maybe a) THasOne where extract _ = THasOneANote that there is already a default general instance returning o. Hence, you do not need to define one. Otherwise, you would have to define an overlapping instance such as: Winstance Extractor ExtractMaybe a b THasZero where -- Incorrect extract _ = THasNone(Except the above wouldn't quite work anyway given the rules for overlapping instances.) So just assume that any instance you don't explicitly define for your " will automatically fall back to .,More than one matching field has been found.%Zero matching fields have been found.*Exactly one matching field has been found.Dirty trick to construct "less specific" overlapping instances by making a class argument a simple type variable, but constraining that variable to be a particular type. E.g., neither of the following two instances is more specific than the other, because NO is not more general than YES: class MyClass a b c | a b -> c where myClass :: a -> b -> c () instance MyClass a a YES where myClass _ _ = YES () instance MyClass a b NO where myClass _ _ = NO ()Hence, attempting to use the first instance will generate a compilation error rather than inferring the type of c as YES. On the other hand, of the following two instances, the first is more specific than the second: instance MyClass a a YES where myClass _ _ = YES () instance (TypeGCast NO c) => MyClass a b c where myClass _ _ = typeGCast $ NO ()That's because c is more general than YES?. The key to this working is that an instance context--i.e., (TypeGCast NO c)n--is never consulted during instance selection, only to validate an already-selected most-specific instance. Note that YES and NO in these examples have kind * -> * . Hence the G in  TypeGCast:. The same trick is equally applicable to types of kind *4, we just don't happen to need that in this module. A variant of  in which the type of the field is supplied as a non-strict argument. This may be easier than typecasting the extractor argument. For example, to extract the  from a structure with a single  field:  getFieldPos'  myStruct ( :: ) 1! None 2346JKM! A data structure representing a dedicated join table in the database. A join table differs from a model in that rows do not have primary keys. Hence, model operations do not apply. Nonetheless a join table conveys information about a relationship between models.Note that all names in a  JoinTable should be unquoted.6Name of the join table in the database. (Not quoted.)Name of the column in table  that contains a | to model a#. (Not quoted or table-qualified.)Like  for model b. DBRefInfo> is a type alias for the common case that the reference in a  is a | (as opposed to a yk). The functions in this library do not care what type of reference is used. The type is generalized to 1 just to make it easier to assign a selector to  when the selector returns a y. Note, however, that  returns a = regardless of the flavor of reference actually encountered.:A common type of association is when one model contains a | or yE pointing to another model. In this case, the model containing the | is known as the child,, and the referenced model is known as the parent.Two pieces of information are required to describe a parent-child relationship: First, the field selector that extracts the Haskell | from the haskell type child?, and second the name of the database column that stores this | field.$For example, consider the following: }data Author = Author { authorId :: DBKey } deriving (Show, Generic) instance Model Author data Post = Post { postId :: DBKey , postAuthorId :: DBRef Author } deriving (Show, Generic) instance Model Post post_author_refinfo :: DBRefInfo Post Author post_author_refinfo = DBRefInfo { dbrefSelector = postAuthorId , dbrefQColumn = "\"post\".\"postAuthorId\"" }7Note that the parent-child relationship described by a  GDBRefInfo, is asymmetric, but bidirectional. When a  child parent% exists, the schema should generally not" permit the existence of a valid  parent child structure. However, the  function generates $s in both directions from a single .Constructing such parent-child 9s requires knowing how to extract primary keys from the parentA type as well as the name of the column storing primary keys in parent@. Fortunately, this information is already available from the T- class, and thus does not need to be in the  GDBRefInfo. (Most functions on  GDBRefInfo s require parent and child to be instances of T.) When your Ts are instances of Generic& (which will usually be the case), a - structure can be computed automatically by -. This is the recommended way to produce a  GDBRefInfo. (Alternatively, see   and  & to make use of an entirely implicit  DBRefInfo.)%Field selector returning a reference. Literal SQL for the database column storing the reference. This should be double-quoted and table-qualified, in case the column name is a reserved keyword, contains capital letters, or conflicts with the name of a column in the joined table. An example would be: /dbrefQColumn = "\"table_name\".\"column_name\""=A data structure representing a relationship between a model a and a model b. At a high level, an Association a b% tells you how to find rows of type b given rows of type aO. More concretely, this boils down to being able to make two types of query.You want to look up a bunch of (a  b)(s, filtering using predicates on both a and bX (e.g., get a list of recent posts and their authors). For this purpose, you can use , which allows you to ) predicates mentioning columns in both a and b.%You already have an instance of type a, and want to find all the b/s associated with it. For that you use either  or ! (which internally access fields , , and ). This type of query is strictly less general than the first one, but can be formulated in a more efficient way by extracting values directly from a concrete instance of a without needing to touch table a in the database. Note that an  Association* is asymmetric. It tells you how to get bs from as, but not vice versa. In practice, there will almost always be an association in the other direction, too. Functions such as  and  therefore create an  Association; and its inverse simultaneously, returning them as a pair.*General select returning all instances of a and b* that match according to the association.The right-hand side of the . query. This query makes no mention of type a (but can be combined with the next two fields to form an optimized query). You probably never want to use this directly, and should instead use either  or 7. Also note this is not useful for selecting all the b,s in the relation; for that you should use .A WHERE clause to find all the b s associated with a particular a9. This can often be done more efficiently than through . The clause contains '?'* characters which should be filled in by .0The query parameters for the query returned by .A projection of ', extracting only the fields of model b&. Note that this query touches table a* even if it does not return results from a. Hence, you can use  to add predicates on both a and b. (Note the contrast to , which does not touch table a& at all, and hence in the case of an  INNER JOIN might return rows of b/ that should not be part of the association. / is intended for use only in conjunction with .) Returns a  for all b s associated with a particular a.+Follow an association to return all of the b s associated with a particular a. The behavior is similar to: 0findAssoc' ab c a = dbSelect c $ assocWhere ab aBut if the first argument is a static association, this function may be marginally faster because it pre-renders most of the query."Combine two associations into one.rCombine two associations into one, and project away the middle type. (The middle type can still be mentioned in WHERE clauses.) An example: data Author = Author { authorId :: DBKey } deriving (Show, Generic) instance Model Author where modelInfo = underscoreModelInfo "author" data Post = Post { postId :: DBKey , postAuthorId :: DBRef Author } deriving (Show, Generic) instance Model Post where modelInfo = underscoreModelInfo "post" data Comment = Comment { commentId :: DBKey , commentPostId :: DBRef Post } deriving (Show, Generic) instance Model Comment where modelInfo = underscoreModelInfo "comment" author_posts :: Association Author Post post_author :: Association Post Author (post_author, author_posts) = dbrefAssocs defaultDBRefInfo -- Could equally well use dbrefAssocs as above post_comments :: Association Post Comment post_comments = has comment_post :: Association Comment Post comment_post = belongsTo comment_author :: Association Comment Author comment_author = chainAssoc comment_post post_author author_comments :: Association Author Comment author_comments = chainAssoc author_posts post_comments Creates a  from a model child that references parent. For this to work, the child type must be an instance of GenericG and must contain exactly one field of the any of the following types:  rt parent, which matches both | parent and y parent.Maybe ( rt parent),, for cases where the reference might be NULLB. Note, however, that an exception will be thrown if you call  on a child whose reference is _..A special case arises when a Model contains a |_ to itself. If you just wish to find parents and children given an existing structure (i.e., ), it is okay to declare an  MyType MyType*. However, in this case attempts to use P will then fail. To work around this problem, the parent must use a row alias.Note that currently  aliasing the child will not work , since the O# data structure will not contain a |" field, only the contents of the O= data structure. An example of doing this correctly (using   and  , both of which wrap defaultDBRefInfo): data Bar = Bar { barId :: !DBKey , barName :: !String , barParent :: !(Maybe (DBRef Bar)) } deriving (Show, Generic) instance Model Bar where modelInfo = underscoreModelInfo "bar" data ParentBar = ParentBar instance RowAlias ParentBar where rowAliasName _ = "parent_bar" toParent :: Association Bar (As ParentBar Bar) toParent = belongsTo toChild :: Association (As ParentBar Bar) Bar toChild = has0Generate both the child-parent and parent-child s implied by a .  Short for "snd $ dbrefAssocs defaultDBRefInfoNote the inverse  is given by  . For example, given the Author and Post, models described in the documentation for , in which each Post references an Author, you might say: xauthor_post :: Association Author Post author_post = has post_author :: Association Post Author post_author = belongsTo The inverse of   . Short for "fst $ dbrefAssocs defaultDBRefInfoSee an example at  . 0The default join table has the following fields:jtNameI is the name of the two models (in alphabetical order), separated by an '_' character. is the name of model a, an '_'= character, and the name of the primary key column in table a. is the name of model b, an '_'= character, and the name of the primary key column in table b. Note that  3 cannot create a default join table for joining a model to itself, as following these rules the two columns would have the same name. If you wish to join a table to itself, you have two options: First, you can define the join table and assign the column names manually. This will permit you to call (, but you still will not be able to use  for more complex queries, since SQL does not permit joins between two tables with the same name. The second option is to give one of the sides of the join table a row alias with O. For example: Edata ParentBar = ParentBar instance RowAlias ParentBar where rowAliasName _ = "parent_bar" selfJoinTable :: JoinTable Bar (As ParentBar Bar) selfJoinTable = defaultJoinTable selfJoin :: Association Bar (As ParentBar Bar) otherSelfJoin :: Association (As ParentBar Bar) Bar (selfJoin, otherSelfJoin) = jtAssocs selfJoinTable Flip a join table. This doesn't change the name of the table (since the same join table is used in both directions, and the default join table name glues together the two model names in alphabetical order anyway). A SQL statement suitable for adding a pair to a join table. Note that the statement takes two parameters (i.e., contains two '?'z characters) corresponding to the primary keys of the two models being associated. These parameters can be supplied by .AAdd an association between two models to a join table. Returns G* if the association was not already there.>A SQL statement for removing a pair from a join table. Like  1, the query is parameterized by two primary keys.2Remove an association from a join table. Returns G* if the association was previously there.Remove an assocation from a join table when you don't have the target instances of the two models handy, but do have references.Generate parameters for   and .. The returned list is suitable for use as a V instance. For example: 9execute conn (jtAddStatement my_join_table) (jtParam a b)&Generate a one-way association from a . Use  instead.+Generate the two associations implied by a .[Generate a one-way association based on the default join table naming scheme described at  . Defined as: $joinTable = jtAssoc defaultJoinTable For example: RaToB :: Association A B aToB = joinTable bToA :: Association B A bToA = joinTable/     $     $     "     NoneSOPQRSTU[stuvwxy|   TTU[stuvwx|yOPQRS   None3JKMThis is a helper class used to extract the row types. You don't need to use this class. If you are creating custom types, just declare an instance of .XStatement for creating the table corresponding to a model. Not strict in its argument.(Create a the database table for a model.-Create the database table corresponding to a .$Create a join table in the database.  A list of (field,type)5 pairs to overwrite the default SQL types of fields."A list of extra table constraints.KA non-strict argument to specify which model's table you want to create. (undefined :: YourModel) should be fine.  !"#$%&'()*+,-./0123456789:;;<=>?@ABCDEEFGHIJKLMNOPQRSTUV W W X X Y Y Z [ [ \ ] ^ _ ` a b c d e f g g h i j j k l m n o o p q r s t u v w x y z { { | } ~                                                         !"#$%&'(')*+,-./0123456789::;<=>?@ABCDEFGEFHI7JKLMNOPQRSQRTUVWXYZ[QR\ ]^_`aZbXcQdeQdfZg h`i j kQlm n o p q r ] s t u v w x y z { | } ~                                          '$                Qd                               QR EFQ                                         postgresql-orm-0.3.2Database.PostgreSQL.ORM#Database.PostgreSQL.ORM.ValidationsDatabase.PostgreSQL.EscapeDatabase.PostgreSQL.MigrationsDatabase.PostgreSQL.MigrateDatabase.PostgreSQL.DescribeDatabase.PostgreSQL.DevelData.RequireSelectorDatabase.PostgreSQL.ORM.Model Database.PostgreSQL.ORM.DBSelectDatabase.PostgreSQL.ORM.SqlType Data.GetField#Database.PostgreSQL.ORM.Association#Database.PostgreSQL.ORM.CreateTablePaths_postgresql_ormpostgresql-simple-0.4.10.0 Database.PostgreSQL.Simple.Types:.ValidationFuncValidationErrorvalidationErrorsvalidatevalidateNotEmpty$fFromJSONValidationError$fToJSONValidationError$fMonoidValidationError$fExceptionValidationError buildIdent quoteIdent buildLiteral buildByteA buildActionbuildSqlFromActionsbuildSqlfmtSql Migration connectEnvmigrate runSqlFilecolumn create_tablecreate_table_stmt drop_tabledrop_table_stmt add_columnadd_column_stmt drop_columndrop_column_stmt rename_columnrename_column_stmt change_columnchange_column_stmt create_indexcreate_unique_indexcreate_index_stmt drop_indexdrop_index_stmt defaultMainMigrationDetails migrationPathmigrationVersion migrationNamedefaultMigrationsDirdumpDb initializeDbrunMigrationsForDirrunRollbackForDir newMigration ColumnInfocolNumcolNamecolType colNotNull colPrimary colUnique colReferences describeTable configLocalDB createLocalDB startLocalDB initLocalDB stopLocalDB setLocalDB withTempDBresetConnectionRequireSelector UpdateRow InsertRow LookupRow lookupRowAsunAsRowAlias rowAliasNameModel modelInfomodelIdentifiers modelRead modelWrite modelQueriesmodelCreateInfo modelValidModelCreateInfomodelCreateColumnTypeExceptionsmodelCreateExtraConstraints ModelQueriesmodelLookupQuerymodelUpdateQuerymodelInsertQuerymodelDeleteQueryModelIdentifiers modelQTable modelQColumnsmodelQPrimaryColumnmodelQWriteColumnsmodelQualifiermodelOrigTableGToRowGFromRow GPrimaryKey0GColumns GDatatypeName ModelInfo modelTable modelColumnsmodelPrimaryColumnmodelGetPrimaryKey DBRefUnique UniqueRefDBRef NormalRefGDBRefDBKeyNullKey DBKeyType isNullKeymkDBRefdefaultModelTabledefaultModelColumnsdefaultModelGetPrimaryKeydefaultFromRow defaultToRowdefaultModelWritedefaultModelInfounderscoreModelInfodefaultModelIdentifiersdefaultModelLookupQuerydefaultModelUpdateQuerydefaultModelInsertQuerydefaultModelDeleteQuerydefaultModelQueriesemptyModelCreateInfofromAstoAs modelName primaryKeymodelSelectFragmentfindAllfindRowsavesave_trySavedestroy destroyByRefprintqCursorcurConncurName curChunkSizecurCacheDBSelectselWithselSelectKeyword selFieldsselFromselWhereKeywordselWhere selGroupBy selHaving selOrderByselLimit selOffset FromClauseFromJoinfcLeftfcJoinOpfcRight fcOnClause FromModel fcVerbatim fcCanonical emptyDBSelectexpressionDBSelect buildDBSelectrenderDBSelect addWhere_addWhere setOrderBysetLimit setOffset addExpression modelDBSelectdbSelectParamsdbSelect curSelectcurNextdbFolddbFoldMdbFoldM_ dbCollectdbJoin dbJoinModels dbProject dbProject'dbNestdbChainSqlType sqlBaseTypesqlType getTypeOid ExtractMaybe ExtractIdGetField getFieldVal getFieldPos GGetField gGetFieldVal gGetFieldPos Extractorextract extractCountTHasMany fromTHasManyTHasNoneTHasOne fromTHasOne getFieldPos' JoinTablejtTable jtColumnA jtColumnB DBRefInfo GDBRefInfo dbrefSelector dbrefQColumn Association assocSelectassocSelectOnlyBassocWhereQueryassocWhereParam assocProject assocWhere findAssoc nestAssoc chainAssocdefaultDBRefInfo dbrefAssocshas belongsTodefaultJoinTablejtFlipjtAddStatementjtAddjtRemoveStatementjtRemove jtRemoveByRefjtParamjtAssocjtAssocs joinTable GDefTypes gDefTypesmodelCreateStatement modelCreatejtCreateStatementjtCreatecatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamecmpres uBuildIdentblaze-builder-0.3.3.4#Blaze.ByteString.Builder.ByteStringfromByteStringDatabase.PostgreSQL.Simplequery formatQueryuncheckedWriteNibbles#bytestring-0.10.4.0Data.ByteString.Internal ByteStringc2bc2b#inlinePerformIO fastFindIndex fastBreakquoter hexNibblesPtrhexCharEscBuildercopyByteToNibbles#Database.PostgreSQL.Simple.Internal ConnectionQueryCmdArgscmd cmdVersion cmdCommit executeQuery_ parseCmdArgs runMigration runRollbackgetDirectoryMigrationssplitFileVersionName isVersionghc-prim GHC.TypesTrueFalse defColInfo ConnectInfo isNonEmptyDir addDirectives singleQuote pgDirectivespgDirectives92systemNoStdoutbase GHC.Generics NoSelectorSelectorIntentionallyCauseError$fRequireSelectora$fRequireSelectorNoSelector Database.PostgreSQL.Simple.ToRowToRow"Database.PostgreSQL.Simple.FromRowFromRowGenericAnyField$Database.PostgreSQL.Simple.FromField FromField"Database.PostgreSQL.Simple.ToFieldToFieldfieldtoRow Data.MaybeJustNothingfromRowdeleteAtAction toUnderscore degen_err Data.EitherEither $fModelAs $fModel:. $fModelMaybe GUnitType gUnitTypeNamegToRowgFromRow gPrimaryKey0gColumns gDatatypeNamejoinModelIdentifiersaliasModelInfoaliasModelIdentifiers$fToRowUpdateRow$fToRowInsertRow$fFromRowLookupRow$fShowAs $fGUnitTypeM1 $fGUnitTypeV1$fGUnitTypeM10$fFromFieldAnyField $fModel(,,,,) $fModel(,,,) $fModel(,,) $fModel(,) $fModel[] $fModelOnly $fGToRowM1 $fGToRow:*: $fGToRowK1 $fGToRowU1 $fGFromRowM1 $fGFromRow:*: $fGFromRowK1 $fGFromRowU1$fGPrimaryKey0M1$fGPrimaryKey0M10$fGPrimaryKey0:*:$fGPrimaryKey0M11 $fGColumnsM1 $fGColumnsM10 $fGColumns:*: $fGColumnsM11 $fGColumnsU1$fGDatatypeNameM1$fShowModelInfo$fToFieldGDBRef$fFromFieldGDBRef $fReadGDBRef $fShowGDBRef$fFromJSONGDBRef$fToJSONGDBRef$fToFieldDBKey$fFromFieldDBKey $fShowDBKey $fOrdDBKey $fEqDBKey$fFromJSONDBKey $fToJSONDBKeyquery_'Blaze.ByteString.Builder.Internal.TypesBuilderOnlyGDBS gdbsDefault gdbsQuerynullFromspaceqNullqBuildertoQuerybuildFromClause catQueriesmergeFromClauses$fGDBSM1 $fGDBS:*:$fGDBSK1 $fGDBSK10$fShowDBSelectMaybepostgresql-libpq-0.9.0.2Database.PostgreSQL.LibPQOidExtractTypeOid$fSqlTypeGDBRef$fSqlTypeGDBRef0$fSqlTypeVector$fSqlTypeMaybe$fSqlTypeDBKey$fSqlTypeBinary$fSqlTypeBinary0 $fSqlType[]$fSqlTypeUnbounded$fSqlTypeUnbounded0$fSqlTypeUnbounded1$fSqlTypeUnbounded2 $fSqlTypeDay$fSqlTypeUTCTime$fSqlTypeTimeOfDay$fSqlTypeZonedTime$fSqlTypeLocalTime $fSqlTypeOid $fSqlTypeText$fSqlTypeText0$fSqlTypeByteString$fSqlTypeByteString0$fSqlTypeInt64$fSqlTypeInt32$fSqlTypeInt16$fSqlTypeFloat$fSqlTypeDouble $fSqlTypeBool$fFromFieldExtractTypeOidRep TypeGCastIntGHC.Err undefinedGCountgCountGCombinegCombine typeGCast($fExtractorExtractMaybeMaybeMaybeTHasOne$$fExtractorExtractMaybeaMaybeTHasOne$fExtractorExtractIdaaTHasOne $fGetFieldfar$fGGetFieldfM1rg$fGGetFieldf:*:rg$fGGetFieldfK1rg$fExtractorfarg$fGCountTHasNone$fGCountTHasMany$fGCountTHasOne!$fGCombineTHasManyTHasOneTHasMany!$fGCombineTHasOneTHasManyTHasMany"$fGCombineTHasManyTHasNoneTHasMany"$fGCombineTHasNoneTHasManyTHasMany"$fGCombineTHasManyTHasManyTHasMany $fGCombineTHasOneTHasOneTHasMany"$fGCombineTHasNoneTHasNoneTHasNone $fGCombineTHasNoneTHasOneTHasOne $fGCombineTHasOneTHasNoneTHasOne $fTypeGCastff ExtractRefjtQTable jtQColumnA jtQColumnB'$fExtractorExtractRefMaybeGDBRefTHasOne($fExtractorExtractRefMaybeGDBRefTHasOne0($fExtractorExtractRefGDBRefGDBRefTHasOne)$fExtractorExtractRefGDBRefGDBRefTHasOne0$fShowGDBRefInfo$fShowAssociationcustomModelCreateStatement $fGDefTypesM1$fGDefTypes:*: $fGDefTypesK1