úν^¡Æÿ¯      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 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 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 { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ   ¡ ¢ £¤¥¦§¨©ª«¬­®Safe7;<=>?AQSTVRÜ &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 ¯ data structure a with exactly one constructor.;Extract the 0-based position of the single field matching   f r within ¯ data structure a . Non-strict in both arguments.(Generlized extraction of a field from a ¯ 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 (³ :: ²)      ´µ¶·±¸Safe;=\ó0iThe 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  NoSelector type a member of the Selector- class. Hence, if you want to ensure a type a is not  NoSelector, 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.00Nonemg4®Internal 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.5Name of the column6Type of the column7If ¹R, the database cannot contain null. (This constraint should always be accurate.)8¹Z if this column (and only this column) constitutes the primary key of the table. Always ºX if the primary key comprises multiple columns (even if this is one of those columns).9¹: if there is a uniqueness constraint on this column. Not ¹  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 2 structures for a particular table. Not all information about a table is returned. In particular, constraints that span columns are ignored. 23456789:; 23456789:;23456789: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 ? or @. (And note that @ 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 ?.)?eStart a local database if the server is not already running. Otherwise, does nothing, but returns a »g in either case. The database server will continue running after the current process exits (but see A).@A combination of > and ?.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 »A 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 Aq if you wish to stop the server process (which you should always do before deleting a test cluster). See also CI to create a temporary cluster for the purposes of running a test suite.AÿStop 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.BSet 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.C›Run 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.D\Reset a connection to its default state before re-cycling it for another thread or request.=>?@ABCD>=?@ABCD TrustworthyDÑb¼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.E<Build a quoted identifier. Generally you will want to use F1, and for repeated use it will be faster to use ¾ . F>, but this internal function is exposed in case it is useful.F~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 Lr.) This function uses a unicode escape sequence to escape '?' characters, which would otherwise be expanded by ¿, À, or L.+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.JA lower-level function used by K and L0. You probably don't need to call it directly.KA builder version of L , possibly useful if you are about to concatenate various individually formatted query fragments and want to save the work of concatenating each individually.L£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 F+ 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.EFGHIJKLLFKJIGHENoneÊNCreates a PostgreSQL à 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.PPRuns the SQL file at the given path, relative to the current working directory.Q3Returns a column defition by quoting the given nameRCreates a table. See Q" for constructing the column list.S Returns a Ä# that creates a table, for example: a create_table "posts" [ column "title" "VARCHAR(255) NOT NULL" , column "body" "text"] T Drops a tableU Returns a Ä that drops a tableV.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".W 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); X1Drops a column from the given table. For example,  drop_column "posts" "title" 0drops the column "title" from the "posts" table.Y 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"; Z1Renames 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") aDrops an index.b Returns a Ä that drops an index. % drop_index_stmt "post_owner_index" Returns the query  DROP INDEX "post_owner_index" Qnametype, definition, constraintsR Table nameColumn definitionsS Table nameColumn definitionsV Table name Column nameColumn definitionW Table name Column nameColumn definitionX Table name Column nameY Table name Column nameZ 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 namesa Index nameb Index namecMigration functionRollback functionMNOPQRSTUVWXYZ[\]^_`abccNPMOQRV^_TXaZ\SW`UYb[]ÅÆÇÈÉNone1<|i Column nameError descriptiondefghij efgnmlkdhijefg None 167;<=KSTVEšQpA newtype wrapper in the Êi class, which marshalls every field except the primary key, followed by the primary key. For use with ‹.rA newtype wrapper in the ÊK class, which marshalls every field except the primary key. For use with Œ.tA newtype wrapper in the ËM class, permitting every model to be used as the result of a database query.w 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 z! X where rowAliasName = const "x" ... r <- dbSelect] c $ addWhere_ "bar.bar_key = x.bar_parent" modelDBSelect :: IO [Bar :. As X Bar] @z2The class of types that can be used as tags in as wµ 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 | instance for w requires a way to extract the name of the row alias without having a concrete instance of the type. This is provided by the {# method (which must be non-strict).{¶Return 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 ¯k class. The default converts the first character of the type name to lower-case, following the logic of ¯.Ì5AnyField parses (simply by consuming) any SQL column.|ÄThe 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 }9, which describes the database table and column names. }L has a reasonable default implementation for types that are members of the ¯ 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 Í 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 } 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  ) 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 (¯, °, ±).} modelInfoc provides information about how the Haskell data type is stored in the database, in the form of a ›ÿ 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.~~– contains the table and column names verbatim as they should be inserted into SQL queries. For normal models, these are simply double-quoted (with F) versions of the names in }~, with the column names qualified by the double-quoted table name. However, for special cases such as join relations (with ) or row aliases (with w), ~C can modify the table name with unquoted SQL identifiers (such as JOIN and AS7) and change the qualified column names appropriately. 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 Ë, a fine definition of  modelRead is modelRead = fromRow7. The default is to construct a row parser using the ¯f class. However, it is crucial that the columns be parsed in the same order they are listed in the ž field of a's ›q 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 <$> Ï <*> Ï <*> Ï €Marshal all fields of a except the primary key. As with [, the fields must be marshalled in the same order the corresponding columns are listed in ž:, only with the primary key (generally column 0) deleted.Do not define this as Ð , even if a is an instance of Ê , 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. modelQueries provides pre-formatted Ä templates for Ä, Å, and È. The default  value is generated from ~[ and should not be modified. However, for degenerate tables (such as joins created with ), it is reasonable to make u 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.‚)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.ŠjA query template for looking up a model by its primary key. Expects a single query parameter, namely the © or ¤ being looked up.‹*A query template for updating an existing |W 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.)Œ%A query template for inserting a new |C 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). A query template for deleting a |F from the database. Should have a single query parameter, namely the © of the row to delete.ެSQL 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 ›a. However, for special cases, the fields of this structure can contain unquoted SQL including JOIN9 keywords. In the case of joins, different elements of ‘, may be qualified by different table names. Note that ‘ and ’, both contain table-qualified names (e.g., "\"my_type\".\"key\"" ), while “' contains only the quoted column names.&Literal SQL for the name of the table.‘-Literal SQL for each, table-qualified column.’@Literal SQL for the model's table-qualified primary key column.“mLiteral 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.”When all columns in ‘< 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 . However, for w models, $ will contain unquoted SQL such as "\"MyType\" AS \"my_alias\"", in which case modelQualifier will contain Ñ "\"my_alias\"".•{The original, unquoted name of the table representing the model in the database. Ordinarily, this should be the same as  in ›, but in the case of w aliases, the  is an alias, and • is the original table. Ò for joins.˜SThis 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.™‹This class extracts the field names of a Haskell data structure. Only defined for types with a single constructor that uses record syntax.š*This class returns the name of a datatype.›A  ModelInfo T1 contains the information necessary for mapping T to a database table. Each | type has a single  ModelInfo, associated with it, accessible through the } method of the |{ class. Note the table and column names must all be unquoted in this data structure, as they will later be quoted using F by the ~ method.IThe name of the database table corresponding to this model. The default } instance uses ¯H, which is the name of your data type with the first letter downcased.ž±The 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  parses them to an a and € 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.Ÿ0The 0-based index of the primary key column in žC. 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  0--no check is made that the two are consistent. oReturn the primary key of a particular model instance. If you customize this field, you must also customize Ÿ0--no check is made that the two are consistent.¡A  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.¢Phantom 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 ¡' 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 |.¥Phantom type for instantiating §< that represents a one-to-many relationship between tables.§"Many operations can take either a ¤ or a ¡) (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 ¢).©OThe type of the Haskell data structure field containing a model's primary key.Every | must have exactly one DBKey , and the DBKey must be the |X'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 |u stored in the database should have a unique non-null primary key. However, the key is determined at the time the |C is inserted into the database. While you are constructing a new |I 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 |*'s primary key as a reference in another |, do not copy the © structure. Use ® to convert the |*'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 |'s primary key and ¤0 to reference the primary key of another model.­Returns ¹ when a © is «.®+Create a reference to the primary key of a |, suitable for storing in a ¤ or ¡ field of a different |.¯ÿ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 ¯& types, suitable as a default of the Ë? class. This module uses it as the default implementation of .³This function provides a Ð function for ¯ 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 €t (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 €; functions. You probably don't want to call this function.ÔMRemoves a single element from the list at the position specified. (Internal)´Returns a series of Õbs 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 }. See the documentation at | for more information. Sets S to the name of the type with the first character converted to lower-case. Sets ž5 to the names of the Haskell field selectors. Sets Ÿ to 04 and extracts the first field of the structure for  v. 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 Ÿ; is 0. If you overwrite that, you will need to overwrite  " as well (and likely vice versa).¶ An alternate |ÿ3 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.ÖPConvert 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 } and ž fields of › using F.¸%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 .½A „9 that doesn't imply any extra constraints or exceptions.×Degenerate instances of | for types in the Ê class are to enable extra Ê types to be included with  in the result of dbSelect queries.¾fromAs extracts the row from an w 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 w+ constructor, under the same rationale as ¾$. Not strict in its first argument.À Lookup the  of a | (modelName _ =  (} :: › a)).ÁLookup the primary key of a |.Â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 w and .Ä Follow a ¤ or ¡4 and fetch the target row from the database into a | type r.ÅLike Ç but instead of returning an Ø , throws a e if the | is invalid.ÆÅ/ but returning '()' instead of the saved model.ÇWrite a |* 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 | is written with an UPDATE query and returned as-is.If the |& 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.éCA 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.óEA 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) ÷A degenerate instance of |# 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 w models.\Fpqrstuvwxyz{|}ƒ~€‚„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊ`|}}~€€‚ƒ›œžŸ Ž‘’“”•ˆ‰Š‹Œ¶¬©ª«­¤¡§¨®ÃÄÅÆÇÈÉÀÁÂtuvpqrswxy¾¿z{{µ¯°±·´¼¸¹º»F¥¦¢£„…†‡½²³Ê˜™š—–pqrstuvwxyz{{ÙÚÌÛ| }}~€€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–Ü—ݘÞ™ßšà›œžŸ ¢£¥¦§¨©ª« None;=VT§ƒThe 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.ãä  Trustworthy "#6;=STVɘ"2+Datatype that represents a connected cursor8‹A 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 8" structure into a subquery using d).; 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.EAs 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 8 (A :. B) and a 8 (B :. C),, it is desirable to be able to generate a 8 (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 e and fJ, but it requires the ability to locate and replace the instance of type B in one 8 with the  FromClause of the other 8.The Ix field is a canonical name of each type, which by convention is the quoted and fully-qualified table name. Comparing I¡ 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.H Verbatim SQL for a table, table AS# alias, or parenthesized subquery.IMCanonical 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 J and LY. 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 e and f.KUsually "JOIN"MON or USING clause (or empty)NA 8 structure with keyword "SELECT" and everything else empty.OA 8i 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.P Create a æ for a rendered version of a 8k. This can save one string copy if you want to embed one query inside another as a subquery, as done by dd, and thus need to parenthesize it. However, the function is probably not a useful for end users.QTurn a 8 into a Ä suitable for the ¿ or å functions.R!Add a where clause verbatim to a 8. 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 Y.SWAdd 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)TSet the ORDER BY clause of a 8 . Example: ZdbSelect c $ setOrderBy "\"employeeName\" DESC NULLS FIRST" $ modelDBSelectUSet the LIMIT clause of a 8.VSet the OFFSET clause of a 8.W/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 Ë$ 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)]XA 8" that returns all rows of a model.YRun a 8% query on parameters. The number of '?'/ characters embedeed in various fields of the 8< must exactly match the number of fields in parameter type p1. Note the order of arguments is such that the 8g can be pre-rendered and the parameters supplied later. Hence, you should use this version when the 8' is static. For dynamically modified 8 structures, you may prefer Z.ZRun a 8' query and return the resulting models.[ Create a 2 for the given 8\Fetch the next | for the underlying 2Ô. 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 8A and consumes them using a left-fold. Uses default settings for 2 (batch size is 256 rows).^Streams results of a 8I and consumes them using a monadic left-fold. Uses default settings for 2 (batch size is 256 rows)._Streams results of a 8I and consumes them using a monadic left-fold. Uses default settings for 2 (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.aCreate a join of the <, =, and ? clauses of two 8: queries. Other fields are simply taken from the second 8, meaning fields such as :, @, and B in the in the first 8 are entirely ignored.b A version of a that uses X for the joined tables.cDRestrict the fields returned by a DBSelect to be those of a single | 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.dLike c, but renders the entire input 8P 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 8– will be faithrully rendered into the subquery (whereas otherwise they could get dropped by join operations). Generally you will still want to use c, but  dbProject' is available when needed.eNest two type-compatible JOIN queries. As with a, fields of the first JOIN (the 8 (a :. b)) other than <, =, and ? are entirely ignored.fLike e$, but projects away the middle type b.a First tableJoin keyword ("JOIN",  "LEFT JOIN", etc.) Second tablePredicate (if any) including ON or USING keywordb Join keywordON or USING predicate523456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef689:;<=>?@ABCDEFGHIJKLMIYZ234567[\]^_`QPNOXabcdefRSTUVW234567èéê8 9:;<=>?@ABCDE FGHIJKLMI None ;<=>?STVƒ !nÿ 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.p6Name of the join table in the database. (Not quoted.)qName of the column in table p that contains a ¤ to model a#. (Not quoted or table-qualified.)rLike q for model b.s DBRefInfo> is a type alias for the common case that the reference in a t is a ¤ (as opposed to a ¡k). The functions in this library do not care what type of reference is used. The type is generalized to t1 just to make it easier to assign a selector to v when the selector returns a ¡. Note, however, that ƒ returns a s= regardless of the flavor of reference actually encountered.t:A common type of association is when one model contains a ¤ or ¡E 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 s child parent% exists, the schema should generally not" permit the existence of a valid s parent child structure. However, the „ function generates x$s in both directions from a single s.Constructing such parent-child x9s 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 |- class, and thus does not need to be in the  GDBRefInfo. (Most functions on  GDBRefInfo s require parent and child to be instances of |.) When your |s are instances of Generic& (which will usually be the case), a s- 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.)v%Field selector returning a reference.wÿ 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\""x=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 z, which allows you to S) 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 a‚s, 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.z*General select returning all instances of a and b* that match according to the association.{The right-hand side of the z. 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 z. The clause contains '?'* characters which should be filled in by }.}0The query parameters for the query returned by |.~A projection of z', 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 S 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 8 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 a„But 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 s 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 ¡ 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 x MyType MyType*. However, in this case attempts to use zP 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 w# data structure will not contain a ¤" field, only the contents of the w= 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 = has„0Generate both the child-parent and parent-child xs implied by a t.… Short for "snd $ dbrefAssocs defaultDBRefInfoNote the inverse x is given by †. For example, given the Author and Post, models described in the documentation for t, 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.q is the name of model a, an '_'= character, and the name of the primary key column in table a.r 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 z· 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 w. 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 ¹* 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 ¹* 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 Ê instance. For example: 9execute conn (jtAddStatement my_join_table) (jtParam a b)&Generate a one-way association from a n. Use  instead.+Generate the two associations implied by a n.‘[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$nopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘$xyz{|}~€tuvwsƒ„…†nopqr‡‘ŠŒ‰‹Žˆ‚nopqrëìtuvwxyz{|} None<STVŽššThis 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 n.Ÿ$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.š›œžŸœš›žŸš›NoneTefghijwxyz{|}ƒ›œžŸ ¡¤©ª«®µ¶¾ÁÃÄÅÇÈÉ89:;<=>?@ABCDRSTUVXYZnopqrstuvwxz~€‚ƒ„…†‡ŠŒW|}}ƒ›œžŸ µ¶©ª«¤¡®Áwxyz{{¾ÄÃÅÇÈÉ89:;<=>?@ABCDXYZRSTUVxzz~€tuvwsƒ„…†nopqr‡ŠŒ‚efgijhSafe‘ìîïðñòóôõNone¡S¨1The default relative path containing migrations: "db/migrations"©3Dumps 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.ªwInitializes the database by creating a "schema-migrations" table. This table must exist before running any migrations.«Runs 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.öYRun a migration. The returned exit code denotes the success or failure of the migration.÷YRun a migration. The returned exit code denotes the success or failure of the migration.«Log output (probably stdout)'Path to directory containing migrations £¤¥¦§¨©ª«¬­ ª«¬©­¨£¤¥¦§£¤¥¦§ø  !!"#$%&'()*+,-./0123456789:;<=>??@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqqrstuvwxyz { { | | } } ~   €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ ‹ Œ Ž Ž ‘ ’ “ “ ” • – — ˜ ™ š › œ  ž Ÿ Ÿ   ¡ ¢ £ ¤ ¥ ¥ ¦ § § ¨ ¦ © © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                                  ! " # $ % & ' ( ) * + , - . / 0 1 1 2 3 4 5 6 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 Y Z [ \ ] ^ _ ` a b c d e f g h i j k k l m n o p o q r s s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ š › œžŸ ¡¢£¤¥¦§¨©ª¨©«¬­®¯¨°±²³´µ¶­®·­®¸¹º»¼½¾¿ÀÁÀÂýÄŹÆÇÈÈÉÊËÌÍÎÏ ÐÑÒÓÔÎÕÌ֍ר¨×ÙÎÚ ÛÓÜ Ý Þ¨ßà á â Ð ã ä å æ ç¨×èéêë ì ìÀí½¾îï ð ñ ò ó ó ôõö÷øùúûüýþÿ+postgresql-orm-0.5.0-5JWasWwlV8G1GljA1bZu8YDatabase.PostgreSQL.ORM Data.GetFieldData.RequireSelectorDatabase.PostgreSQL.DescribeDatabase.PostgreSQL.DevelDatabase.PostgreSQL.EscapeDatabase.PostgreSQL.Migrations#Database.PostgreSQL.ORM.ValidationsDatabase.PostgreSQL.ORM.ModelDatabase.PostgreSQL.ORM.SqlType Database.PostgreSQL.ORM.DBSelect#Database.PostgreSQL.ORM.Association#Database.PostgreSQL.ORM.CreateTableDatabase.PostgreSQL.MigratePaths_postgresql_orm0postgresql-simple-0.5.3.0-F5ZWV7bgEgBHMmqiDrz13B Database.PostgreSQL.Simple.Types:. ExtractMaybe ExtractIdGetField getFieldVal getFieldPos GGetField gGetFieldVal gGetFieldPos Extractorextract extractCountTHasMany fromTHasManyTHasNoneTHasOne fromTHasOne getFieldPos' $fTypeGCastff!$fGCombineTHasManyTHasOneTHasMany!$fGCombineTHasOneTHasManyTHasMany"$fGCombineTHasManyTHasNoneTHasMany"$fGCombineTHasNoneTHasManyTHasMany"$fGCombineTHasManyTHasManyTHasMany $fGCombineTHasOneTHasOneTHasMany"$fGCombineTHasNoneTHasNoneTHasNone $fGCombineTHasNoneTHasOneTHasOne $fGCombineTHasOneTHasNoneTHasOne$fGCountTHasNone$fGCountTHasMany$fGCountTHasOne$fExtractorfarg$fGGetFieldfM1rg$fGGetFieldf:*:rg$fGGetFieldfK1rg $fGetFieldfar$fExtractorExtractIdaaTHasOne($fExtractorExtractMaybeMaybeMaybeTHasOne$$fExtractorExtractMaybeaMaybeTHasOne $fShowTHasOne$fShowTHasNone$fShowTHasMany$fShowExtractIdRequireSelector$fRequireSelectora ColumnInfocolNumcolNamecolType colNotNull colPrimary colUnique colReferences describeTable$fShowColumnInfo configLocalDB createLocalDB startLocalDB initLocalDB stopLocalDB setLocalDB withTempDBresetConnection 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 defaultMainValidationFuncValidationErrorvalidationErrorsvalidationErrorvalidatevalidateNotEmpty$fFromJSONValidationError$fToJSONValidationError$fMonoidValidationError$fExceptionValidationError$fShowValidationError 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 destroyByRefprintq$fToFieldDBKey$fFromFieldDBKey $fShowDBKey $fOrdDBKey $fEqDBKey$fFromJSONDBKey $fToJSONDBKey$fToFieldGDBRef$fFromFieldGDBRef$fFromJSONGDBRef$fToJSONGDBRef$fShowModelInfo$fGDatatypeNameM1 $fGColumnsM1 $fGColumnsM10 $fGColumns:*: $fGColumnsM11 $fGColumnsU1$fGPrimaryKey0M1$fGPrimaryKey0M10$fGPrimaryKey0:*:$fGPrimaryKey0M11 $fGFromRowM1 $fGFromRow:*: $fGFromRowK1 $fGFromRowU1 $fGToRowM1 $fGToRow:*: $fGToRowK1 $fGToRowU1 $fModel:. $fModel(,,,,) $fModel(,,,) $fModel(,,) $fModel(,) $fModel[] $fModelOnly $fReadGDBRef $fShowGDBRef$fFromFieldAnyField $fModelMaybe $fGUnitTypeM1 $fGUnitTypeV1$fGUnitTypeM10 $fModelAs$fShowAs$fFromRowLookupRow$fToRowInsertRow$fToRowUpdateRow $fDataDBKey$fGenericDBKey $fEqGDBRef $fDataGDBRef $fNumGDBRef$fIntegralGDBRef $fRealGDBRef $fOrdGDBRef $fEnumGDBRef$fBoundedGDBRef$fGenericGDBRef$fShowNormalRef$fDataNormalRef$fShowUniqueRef$fDataUniqueRef$fShowModelIdentifiers$fShowModelQueries$fShowModelCreateInfo$fShowLookupRow$fShowInsertRow$fShowUpdateRowSqlType sqlBaseTypesqlType getTypeOid$fFromFieldExtractTypeOid$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 $fSqlTypeBoolCursorcurConncurName curChunkSizecurCacheDBSelectselWithselSelectKeyword selFieldsselFromselWhereKeywordselWhere selGroupBy selHaving selOrderByselLimit selOffset FromClause FromModelFromJoin fcVerbatim fcCanonicalfcLeftfcJoinOpfcRight fcOnClause emptyDBSelectexpressionDBSelect buildDBSelectrenderDBSelect addWhere_addWhere setOrderBysetLimit setOffset addExpression modelDBSelectdbSelectParamsdbSelect curSelectcurNextdbFolddbFoldMdbFoldM_ dbCollectdbJoin dbJoinModels dbProject dbProject'dbNestdbChain$fShowDBSelect$fGDBSM1 $fGDBS:*:$fGDBSK1 $fGDBSK10$fShowFromClause$fGenericDBSelect JoinTablejtTable jtColumnA jtColumnB DBRefInfo GDBRefInfo dbrefSelector dbrefQColumn Association assocSelectassocSelectOnlyBassocWhereQueryassocWhereParam assocProject assocWhere findAssoc nestAssoc chainAssocdefaultDBRefInfo dbrefAssocshas belongsTodefaultJoinTablejtFlipjtAddStatementjtAddjtRemoveStatementjtRemove jtRemoveByRefjtParamjtAssocjtAssocs joinTable$fShowAssociation$fShowGDBRefInfo'$fExtractorExtractRefMaybeGDBRefTHasOne($fExtractorExtractRefMaybeGDBRefTHasOne0($fExtractorExtractRefGDBRefGDBRefTHasOne)$fExtractorExtractRefGDBRefGDBRefTHasOne0$fShowExtractRef$fShowJoinTable GDefTypes gDefTypesmodelCreateStatement modelCreatejtCreateStatementjtCreate $fGDefTypesM1$fGDefTypes:*: $fGDefTypesK1MigrationDetails migrationPathmigrationVersion migrationNamedefaultMigrationsDirdumpDb initializeDbrunMigrationsForDirrunRollbackForDir newMigration$fShowMigrationDetailsbase GHC.GenericsGenericRep TypeGCastghc-prim GHC.TypesIntGHC.Err undefinedGCountgCountGCombinegCombine typeGCastTrueFalse#Database.PostgreSQL.Simple.Internal ConnectInfocmpres uBuildIdentbytestring-0.10.8.2 Data.ByteString.Builder.Internal byteStringDatabase.PostgreSQL.Simplequery formatQueryuncheckedWriteNibbles#Data.ByteString.Internal ByteString ConnectionQueryCmdArgscmd cmdVersion cmdCommit Database.PostgreSQL.Simple.ToRowToRow"Database.PostgreSQL.Simple.FromRowFromRowAnyField$Database.PostgreSQL.Simple.FromField FromField"Database.PostgreSQL.Simple.ToFieldToFieldfieldtoRowGHC.BaseJustNothingfromRowdeleteAtAction toUnderscore degen_err Data.EitherEither GUnitType gUnitTypeNamegToRowgFromRow gPrimaryKey0gColumns gDatatypeNameMaybe/postgresql-libpq-0.9.3.1-8jMYZXnIAmTBsSVRHWMv1lDatabase.PostgreSQL.LibPQOidExtractTypeOidquery_BuilderOnlyGDBS gdbsDefault gdbsQuery ExtractRefcustomModelCreateStatementversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName runMigration runRollback