"      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      ! None!"&*+-013457>CDFIKLN!The * from SELECT *O  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ"N  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ" None!"&*+-013457>CDFIKLN \5The big Kahuna! All beam tables implement this class.]The kind of all table types is `(* -> *) -> *`. This is because all table types are actually table type constructorsD. Every table type takes in another type constructor, called the  column tagZ, and uses that constructor to instantiate the column types. See the documentation for pD. In order for the default deriving to work, every type passed into p must be an instance of V.This class is mostly Generic-derivable. You need only specify a type for the table's primary key and a method to extract the primary key given the table.jEven though all methods are derivable, you are free to override them. Typically, you may want to override cP if you want to specify options for column storage or to rename columns. See h+ for more information. You may want to use tableConfigLenses to simplify accessing c.An example table: #data BlogPostT f = BlogPost { _blogPostSlug :: Columnar f Text , _blogPostBody :: Columnar f Text , _blogPostDate :: Columnar f UTCTime , _blogPostAuthor :: PrimaryKey AuthorT f , _blogPostTagline :: Columnar f (Maybe Text) , _blogPostImageGallery :: PrimaryKey ImageGalleryT (Nullable f) } deriving Generic instance Table BlogPostT where type PrimaryKey BlogPostT f = PK f Text primaryKey = PK . _blogPostSlug!We can interpret this as follows:The  _blogPostSlug,  _blogPostBody,  _blogPostDate, and _blogPostTagline fields are of types #, #, UTCTime , and 'Maybe Text' respectfully.Since  _blogPostSlug,  _blogPostBody,  _blogPostDate, _blogPostAuthor, must be provided (i.e, they cannot contain $7), they will be given SQL NOT NULL constraints. _blogPostTagline is declared % so $) will be stored as NULL in the database. _blogPostImageGallery1 will be allowed to be empty because it uses the m tag modifier.blogPostAuthor references the AuthorT( table (not given here) and is required.blogPostImageGallery references the  ImageGalleryTL table (not given here), but this relation is not required (i.e., it may be $. See m).]A data type representing the types of primary keys for this table. In order to play nicely with the default deriving mechanism, this type must be an instance of .^Given a table, this should return the PrimaryKey from the table. By keeping this polymorphic over column, we ensure that the primary key values come directly from the table (i.e., they can't be arbitrary constants)hMetadata for a field of type ty in table. 4Columnar (TableField table) ty = TableField table tyThis is used to declare c in the \ class.8It is easiest to access these fields through the lenses , , and .  data EmployeeT f = Employee { _employeeId :: Columnar f AutoId , _employeeDepartment :: Columnar f Text , _employeeFirstName :: Columnar f Text , _employeeLastName :: Columnar f Text } deriving GenericNow we can use tableConfigLenses and the h1 lenses to modify the default table configuration Employee (LensFor employeeIdC) (LensFor employeeDepartmentC) (LensFor employeeFirstNameC) (LensFor employeeLastNameC) = tableConfigLenses instance Table EmployeeT where type PrimaryKey EmployeeT f = PK f AutoId primaryKey = PK . _beamEmployeeId tblFieldSettings = defTblFieldSettings & employeeFirstNameC . fieldName .~ "fname" & employeeLastNameC . fieldName .~ "lname" & employeeLastNameC . fieldSettings .~ Varchar (Just 128) -- Give it a 128 character limitjThe field namekBConstraints for the field (such as AutoIncrement, PrimaryKey, etc)lSettings for the fieldm,Support for NULLable Foreign Key references. data MyTable f = MyTable { nullableRef :: PrimaryKey AnotherTable (Nullable f) , ... } deriving (Generic, Typeable)See p for more information.pBA type family that we use to "tag" columns in our table datatypes.This is what allows us to use the same table type to hold table data, describe table settings, derive lenses, and provide expressions.The basic rules are :Columnar Identity x = x Columnar Identity (BeamEnum x) = x Thus, any Beam table applied to s will yield a simplified version of the data type, that contains just what you'd expect. Enum types tagged with qB, are automatically unwrapped in the simplified data structure. .Columnar (Nullable c) x = Columnar c (Maybe x)The m type is used when referencing ]Ps that we want to include optionally. For example, if we have a table with a ], like the following }data BeamTableT f = BeamTableT { _refToAnotherTable :: PrimaryKey AnotherTableT f , ... }9we would typically be required to provide values for the ] embedded into  BeamTableT. We can use m to lift this constraint. data BeamTableT f = BeamTableT { _refToAnotherTable :: PrimaryKey AnotherTableT (Nullable f) , ... }Now we can use justRef and  nothingRef1 to refer to this table optionally. The embedded ] in _refToAnotherTable0 automatically has its fields converted into % using m. The last p rule is Columnar f x = f xUse this rule if you'd like to parameterize your table type over any other functor. For example, this is used in the query modules to write expressions such as 'TableT QExpr', which returns a table whose fields have been turned into query expressions.jThe other rules are used within Beam to provide lenses and to expose the inner structure of the data type. Synonym for ^RSTUVWXYZ[&'()*+,-./012\]^_`abcdefghijklmnopqrstu34vwx5678yz{|}~9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij<RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~WRSTUVWXYZ[&'()*+,-./012\ ]^_`abcdefghijklmnopqrstu34vwx5678yz{|}~;<=>?@BA9CED:FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij None!"&*+-013457>CDFIKLNklmnopqr  klmnopqrNone!"&*+-013457>CDFIKLN!! None!"&*+-013457>CDFIKLNAutomatically deduce lenses for 'TableSettings table'. You can expose the lenses at global level by doing a top-level pattern match on 6, replacing every column in the pattern with `LensFor  nameOfLensForField'. For example, data AuthorT f = AuthorT { _authorEmail :: Columnar f Text , _authorFirstName :: Columnar f Text , _authorLastName :: Columnar f Text } deriving Generic data BlogPostT f = BlogPost { _blogPostSlug :: Columnar f Text , _blogPostBody :: Columnar f Text , _blogPostDate :: Columnar f UTCTime , _blogPostAuthor :: ForeignKey AuthorT f , _blogPostTagline :: Columnar f (Maybe Text) } deriving Generic instance Table BlogPostT where type PrimaryKey BlogPostT f = PK f Text primaryKey = PK . _blogPostSlug instance Table AuthorT where type PrimaryKey AuthorT f = PK f Text primaryKey = PK . _authorEmail BlogPost (LensFor blogPostSlug (LensFor blogPostBody) (LensFor blogPostDate) (ForeignKey (PK (LensFor blogPostAuthorEmail))) (LensFor blogPostTagLine) = tableConfigLenses stuvwxyz{ stuvwxyz{None!"&*+-013457>CDFIKLNIRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~M~|}z{yqrstuxvwpnomhijklg\]^_`abcdefVWXYZ[URSTNone!"&*+-013457>CDFIKLN Wrapper for hs that have been modified in such a way that they can no longer be joined against without the use of subquery.  is also an instance of &, and so can be passed directly to query or  queryList  None!"&*+-013457>CDFIKLN Convert a J into a SQL expression (with placeholders) and literal values to be submitted to the SQL server. Splitting into a SQL expression and literals prevents SQL injection attacks.|}~O  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQOPQJKLMNOFGHIBCDE>?@A:;<=567891234()*+,-./0%&'#$ !" |}~None!"&*+-013457>CDFIKLN None!"&*+-013457>CDFIKLN None!"&*+-013457>CDFIKLNNone!"&*+-013457>CDFIKLN*Introduce all entries of a table into the  monad*Introduce all entries of a table into the ! monad based on the given SQLExpr!Only allow results for which the  yields KIntroduce all entries of the given table which are referenced by the given  ForeignKey0Limit the number of results returned by a query.>The resulting query is a top-level one that must be passed to query,  queryList, or . See  for details.Drop the first offset' results.>The resulting query is a top-level one that must be passed to query,  queryList, or . See  for details.E          <       None!"&*+-013457>CDFIKLN !6      !7      ! !None!"&*+-013457>CDFIKLN  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !          ! " # $ % & & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 7 8 8 9 : : ; < = > ? @ A B B C D E E F G H I I J K L M N O P P Q R S 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 t u v w x y y z { { | } } ~ ~                                    !"#$#% & ' ( ) * + , - . / 0 1 2 3 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{|}~       beam_FOpvnwqBbapGqniwuiCFaY Database.BeamDatabase.Beam.SQLDatabase.Beam.SchemaDatabase.Beam.InternalDatabase.Beam.Query.InternalDatabase.Beam.BackendDatabase.Beam.Backend.Sqlite3Database.Beam.QueryDatabase.Beam.SQL.TypesDatabase.Beam.Schema.TablesDatabase.Beam.Schema.FieldsDatabase.Beam.Schema.LensesDatabase.Beam.Query.TypesDatabase.Beam.Query.CombinatorsbaseData.Typeable.InternalTypeable GHC.GenericsGenericData.Functor.IdentityIdentitytrans_3eG64VdP2vzGjP6wJiCp5XControl.Monad.IO.ClassliftIOSQLExprSQLExpr'SQLValE SQLFieldE SQLBinOpESQLUnOpE SQLIsNothingE SQLIsJustESQLListESQLFuncE SQLOrderingAscDesc SQLGrouping sqlGroupBy sqlHavingSQLFrom SQLFromSourceSQLJoin SQLJoinType SQLInnerJoin SQLLeftJoin SQLRightJoin SQLOuterJoin SQLSourceSQLSourceTableSQLSourceSelect SQLProjection SQLProjStarSQLProj SQLAliased SQLFieldNameSQLQualifiedFieldName SQLSelect selProjectionselFromselWhere selGrouping selOrderByselLimit selOffset SQLDelete dTableNamedWhere SQLUpdate uTableNames uAssignmentsuWhere SQLInsert iTableNameiValues SQLConstraint SQLPrimaryKeySQLAutoIncrement SQLNotNullSQLColumnSchemacsType csConstraintsSQLCreateTable ctTableNamectFields SQLCommandSelectInsertUpdateDelete CreateTable noConstraintsnotNull FromSqlValuesfromSqlValues' valuesNeededFromSqlValuesM FieldSchema FieldSettings defSettingscolDescFromSettings makeSqlValue fromSqlValueTable PrimaryKey primaryKey pkChangeRep changeRep pkAllValuesfieldAllValuestblFieldSettingspkMakeSqlValues makeSqlValuestableFromSqlValues TableSettings TableField _fieldName_fieldConstraints_fieldSettingsNullable Columnar'ColumnarBeamEnum unBeamEnum SqlValue'LensForLensesDatabaseSettings DatabaseTableGenDatabaseTableDatabase allTablesReifiedTableSchemaReifiedDatabaseSchemaallTableSettingsautoDbSettings fieldNamefieldConstraints fieldSettingsreifyTableSchematableValuesNeededpkdefTblFieldSettingsdefFieldSettings popSqlValue peekSqlValueAutoId UnassignedId AssignedId CharOrVarcharCharVarchar AutoIdDefaultDateTimeDefaultTextFieldSettings charOrVarChar EnumSettings maxNameSizeTFCo:R:FieldSettingsAutoIdTFCo:R:FieldSettingsUTCTimeTFCo:R:FieldSettingsTextTFCo:R:FieldSettingsBeamEnumBeamRollbackReason InternalError UserError BeamResultSuccessRollbackBeamTrunBeamTBeambeamDbSettings beamDebug closeBeamcompareSchemasadjustColDescForBackendgetLastInsertedRowwithHDBCConnection BeamBackendopenBeamMigrationAction MACreateTableDBSchemaComparison MigrationUnknown transBeam$fMonadTransBeamT$fMonadIOBeamT$fApplicativeBeamT$fFunctorBeamT $fMonadBeamT$fErrorBeamRollbackReason$fShowMigrationActiontableConfigLenses ProjectibleprojectQExprQField qFieldTblName qFieldTblOrd qFieldName QueryBuilder qbNextTblRefqbFromqbWhereqbLimitqbOffset qbOrdering qbGrouping TopLevelQQrunQIsQuerytoQtableVal$fProjectiblet$fProjectible(,,,,)$fProjectible(,,,)$fProjectible(,,)$fProjectible(,)$fProjectibleQExprppSQL reifyDBSchemadefaultBeamCompareSchemas hdbcSchema createStmtFor migrateDB autoMigrateDB openDatabaseopenDatabaseDebug openDatabase' dumpSchema$fMonoidDBSchemaComparisonSqlite3SettingsgetLastInsertedRow'++.$fBeamBackendSqlite3Settings AggregationGroupAgg GenericAggQExprToIdentity allExprOpts optimizeExpr' optimizeExpr mkSqlField queryToSQL' SqlValableval_HaskellLiteralForQExpr==./=.all_join_guard_related_lookup_ references_limit_offset_<.>.<=.>=.&&.||.not_div_mod_enum_group_sum_count_ aggregateorderByasc_desc_ subquery_ insertInto updateWheresaveTo deleteWhere deleteFrombeamTxnquery queryListgetOne$fMonoidSQLGroupingtext_BKzOMwCPkuv5n8xwLM3CQGData.Text.InternalTextGHC.BaseNothingMaybeGMakeSqlValuesgMakeSqlValuesGFromSqlValuesgFromSqlValuesGDefaultTableFieldSettingsgDefTblFieldSettings AllValues GAllValues gAllValues ChangeRep changeRep' GChangeRep gChangeRepExposed GAllTables allTables'GAutoDbSettingsautoDbSettings'MaybeFieldSettingsIntFieldDefaultfrom'to' fieldColDesc allValues' unCamelCaseunCamelCaseSelTFCo:R:FieldSettingsMaybe$fFieldSchemaMaybe$fFromSqlValuesIntTFCo:R:FieldSettingsInt$fFieldSchemaInt$fFromSqlValues(,,)$fFromSqlValues(,)$fFromSqlValuestbl$fGMakeSqlValuesK1K1K1$fGMakeSqlValuesK1K1K10$fGMakeSqlValuesK1K1K11$fGMakeSqlValuesU1U1U1$fGMakeSqlValues:*::*::*:$fGMakeSqlValuesM1M1M1$fGFromSqlValuesK1K1$fGFromSqlValues:*::*:$fGFromSqlValuesK1K10$fGFromSqlValuesK1K11$fGFromSqlValuesM1M1$fGDefaultTableFieldSettingsM1$fGDefaultTableFieldSettingsM10$fGDefaultTableFieldSettingsM11$fGDefaultTableFieldSettings:*:$fGDefaultTableFieldSettingsM12$fGDefaultTableFieldSettingsM13$fGAllValuesfK1K1$fGAllValuesfK1K10$fGAllValuesfM1M1$fGAllValuesf:*::*:$fChangeRepxfg$fGChangeRepK1K1K1xy$fGChangeRepK1K1K1xy0$fGChangeRep:*::*::*:xy$fGChangeRepM1M1M1xy$fFromSqlValuesMaybe$fGAllTablesfK1$fGAllTablesf:*:$fGAllTablesfM1$fGAutoDbSettingsM1$fGAutoDbSettings:*:$fGAutoDbSettingsM10$fGAutoDbSettingsM11$fFromSqlValuesAutoId$fFieldSchemaAutoId$fFromSqlValuesUTCTime$fFieldSchemaUTCTime$fFromSqlValuesText$fFieldSchemaText$fFromSqlValuesBeamEnum$fFieldSchemaBeamEnum GTableLenses gTableLenses tableLenses' tableLensessimpleTableLenses$fGTableLensestmK1K1$fGTableLensestmK1K10$fGTableLensestm:*::*:$fGTableLensestmM1M1 DocAndValsppCmd ppCreateTable ppFieldSchema ppColSchema ppConstraint ppColTypeppInsert ppAssignmentppUpdateppDeleteppSelppProj ppAliasedppSourceppWhere ppFieldName ppGroupingppHavingppFromppFrom'ppJTypeppOn ppOrderByppValppExpr booleanOpts$fIsQueryTopLevelQ $fIsQueryQTFCo:R:QExprToIdentity(,,)TFCo:R:QExprToIdentity(,)TFCo:R:QExprToIdentityQExprTFCo:R:QExprToIdentitytableghc-prim GHC.TypesTrue SubqueryablesubqueryProjections SqlOrderablemakeSQLOrdering AggregatingLiftAggregationsToQExpraggToSqlliftAggToQExprSqlOrddecomposeToGenQExprsbinOpE$fSubqueryable(,,,,)$fSubqueryable(,,,)$fSubqueryable(,,)$fSubqueryable(,)$fSubqueryableQExpr$fSqlOrderable(,,,,)$fSqlOrderable(,,,)$fSqlOrderable(,,)$fSqlOrderable(,)$fSqlOrderable[]$fSqlOrderableSQLOrdering$fAggregating(,,,,)$fAggregating(,,,)$fAggregating(,,)$fAggregating(,)$fAggregatingAggregation$fAggregatingt$fSqlValabletbl$fSqlValablePrimaryKey$fSqlValableQExpr"TFCo:R:HaskellLiteralForQExprtable"TFCo:R:HaskellLiteralForQExprQExpr $fSqlOrdtbl$fSqlOrdPrimaryKey $fSqlOrdQExpr $fNumQExpr$fIsStringQExprrunSQL' insertToSQL runInsert updateToSQL toBeamResultrunQuery fromSqlValues