!a\B      !"#$%&'()*+,-./0123456789:;<=>?@A Safe.HV&ribbitRender a query. Safe -.=?HUVXBribbitIType level check to see if the field is actually contained in the schema CribbitNormalize nested type strings to be right associative. Mainly used to help simplify the implementation of other type families.ribbitString two types together. D  D  D0 is similar in principal to the nested tuple (D, (D, DL)), but looks a whole lot nicer when the number of elements becomes large.7This is how you build up a schema from a collection of  types.E.g.: ?Field "foo" Int :> Field "bar" Text :> Field "baz" (Maybe Text)It also the mechanism by which this library builds up the Haskell types for query parameters and resulting rows that get returned. So if you have a query that accepts three text query parameters, that type represented in Haskell is going to be (Only Text  Only Text  Only Text).hIf that query returns rows that contain a Text, an Int, and a Text, then the type of the rows will be (Only Text  Only D  Only Text).ribbit+Define a field in a database schema, where:nameW: is the name of the database column, expressed as a type-level string literal, andtyp<: is the Haskell type whose values get stored in the column.E.g:  "company_name" Text  "expiration_date" (E )ribbitType class for defining your own tables. The primary way for you to introduce a new schema is to instantiate this type class for one of your types.E.g.: data MyTable instance Table MyTable where type Name MyTable = "my_table" type DBSchema MyTable = Field "id" Int :> Field "my_non_nullable_text_field" Text :> Field "my_nullable_int_field" (Maybe Int) FGBC55Safe-.HUV#ribbit@Produce the parameters type in relation to a particiular schema.(This type family is open and extendable.ribbit,Produce the type of rows return by a query. ribbitUProduce the type represeting the placeholder ("?") values in a paramaterized query.(This type family is open and extendable.H None-.;=>?HMUVXk> ribbityRepresents the "base" PostgreSQL type. We say "base" type because whether the type is nullable is handle automatically.e.g. PsqlType "integer" #PsqlType "timestamp with time zone" ribbit3Figure out if a Haskell type is "nullable" in sql. ribbit-Produce a list of field names from a schema. ribbitBMake sure the fields in the list are actually part of the schema. ribbitfGiven a Haskell type, produce the PostgreSQL type of columns that store values of that haskell type.Iribbit.Wrapper that helps us avoid orphan instances. ribbitLike J7, but defined here so we can avoid orphaned instances. ribbitLike K., but defined here to avoid orphan instances. ribbitExecute a statement. ribbit+Create the indicated table in the database.See  for details.ribbit-Produce the statement used to create a table.In this example, we create an employee table with a multi-part primary key, one nullable field, and a few non-nullable fields. edata Employee instance Table Employee where type Name = "employees" type DBSchema = Field "company_id" Int :> Field "id" Int :> Field "name" Text :> Field "quit_date" (Maybe Day) let primaryKey :: Proxy '["company_id", "id"] primaryKey = Proxy table :: Proxy Employee table = Proxy in createTableStatement primaryKey table This will produce the statement: "create table employees (company_id integer not null, id integer not null, name text not null, quit_date date, primary key (company_id, id));"LribbitLike M-, but produce any kind of string-like thing. ribbit:Execute a query against a PostgreSQL database connection.    Safe -.=?HUVX?-ribbitInsert statement. - Safe-.HUVMtNribbitrStrip redundant unit types out of a string of types. This is used mainly to help simplify the implementation of  ParamsType.Oribbit Helper for P. Pribbit2Produce the parameters for a comparison operator. .ribbitE"?" constructor, used to indicate the presence of a query parameter. Qribbit@A closed condition is one that does not allow query parameters. /ribbitIs a field not null? 0ribbitIs a field null? 1ribbitNOT conditional constructor. 2ribbitOR constructor for conditions. 3ribbitAND constructor for conditions. 4ribbit!">=" constructor for conditions. 5ribbit ">" constructor for conditions. 6ribbit!"<=" constructor for conditions. 7ribbit "<" constructor for conditions. 8ribbit!"!=" constructor for conditions. 9ribbit "=" constructor for conditions. :ribbitWHERE8 constructor, used for attaching conditions to a query. .RS/0123456789: 273849 59 69 79 89 99 :6 Safe -.=?HUVXX Tribbit*Make all the fields of a schema nullable. Uribbit$Produce the schema for a left join. ;ribbit Left Joins. <ribbitON keyword, for joins. Vribbit_Rename the fields in a given schema to reflect an applied table alias. For instance, data FooWribbit'Produce the schema of a cross product. Xribbit2Product the renderable "name" of a cross product. =ribbitASE constructor, used for attaching a name to a table in a FROM clause. >ribbitFROMU constructor, used for attaching a SELECT projection to a relation in the database.?ribbitSELECT" constructor, used for starting a SELECT statement. YribbitCross Product Z[\;<=>?;8<7=9 >6 Safe.HUVZ@ribbitDelete statement. @ Safe-.HUVZAribbitUpdate statement. ASafe -.=?HUVX[ -./0123456789:;<=>?@A?>=<;-@A:9876543210/. ]  !"#$%&'()*+,-./012345678 9 : ; < = > ? @ A B C D E F G H I J K LMNOPQRSTUVWXYZY[\R]\ ^ _ ` a b c d e f g h i j k lm%ribbit-1.1.0.1-HO21dDbkPjRIn7STpqhCQsDatabase.RibbitDatabase.Ribbit.PostgreSQLDatabase.Ribbit.RenderDatabase.Ribbit.Table Data.TimeDayDatabase.Ribbit.ParamsDatabase.Ribbit.InsertDatabase.Ribbit.ConditionsDatabase.Ribbit.SelectDatabase.Ribbit.DeleteDatabase.Ribbit.UpdateRender:>FieldTableNameDBSchemaParamsTypeSchema ResultType ParamsTypePsqlType unPsqlType HasIsNullable HasFieldsIsSubset HasPsqlTypepsqlType HasPsqlTypesFromRowToRowexecute createTablecreateTableStatementquery $fToRow() $fToRowOnly $fToRow:> $fFromRowOnly $fFromRow:> $fToRowWrap $fFromRowWrap$fHasFields[]:$fHasFields[][]$fHasFieldsTYPE:>$fHasFieldsTYPEField$fHasIsNullableka$fHasIsNullableTYPEMaybe$fHasPsqlTypeTYPEDay$fHasPsqlTypeTYPEInt$fHasPsqlTypeTYPEText$fHasPsqlTypeTYPEMaybe$fHasPsqlTypesTYPE:>$fHasPsqlTypesTYPEField$fIsStringPsqlType InsertInto?NotNullIsNullNotOrAndGteGtLteLt NotEqualsEqualsWhereLeftJoinOnAsFromSelect DeleteFromUpdate ValidFieldFlattenghc-prim GHC.TypesIntbase GHC.MaybeMaybe NotInSchemaValidateProjectionTypeWrap.postgresql-simple-0.6.2-D1UYdsR0dl57fHZjKcxjQh"Database.PostgreSQL.Simple.FromRow Database.PostgreSQL.Simple.ToRow symbolVal GHC.TypeLits StripUnit Comparison CompParamsClosedConditionRenderJoinConditionsRenderConditionsNullableLeftJoinSchemaAliasAsCrossProductSchemaCrossProductName $fTable[]:Expr RenderFieldRenderFieldList