>4m      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M 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 { | } ~                                                                                                                                                                   ! " # $ % & ' ( ) * + , - . / 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 uvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklNone&'+-.01367;<=>?AFKLNQSTVhL,Support for NULLable Foreign Key references. data MyTable f = MyTable { nullableRef :: PrimaryKey AnotherTable (Nullable f) , ... } deriving (Generic, Typeable)See Columnar for more information.Dnewtype mainly used to inspect tho tag structure of a particular BeamableT. Prevents overlapping instances in some case. Usually not used in end-user code.wNewtype wrapper for types that may be given default values by the database. Essentially, a wrapper around 'Maybe x'.<When a value of type 'Auto x' is written to a database (via INSERT or UPDATE*, for example), backends will translate a m value into an expression that will evaluate to whatever default value the database would choose. This is useful to insert rows with columns that are auto-incrementable or have a DEFAULT value.@When read from the database, the wrapped value will always be a ne value. This isn't currently enforced at the type-level, but may be in future versions of beam.Class for all beam backendsNRequirements to marshal a certain type from a database of a particular backend    opq  None&'+-.01367;<=>?AFKLNQSTVhN456789:; ;9:78456>=<456789:None&'+,-.01367;<=>?AFKLNQSTVhT)Included so that we can easily write a Num instance, but not defined in SQL92. Implementations that do not support this, should use CASE .. WHEN ..With time zone With time zone WHERE  Where clause having clause LIMIT OFFSET MNOUTSRQPVXWY\[Z]`_^acbdfegnmlkjiho~}|{zxwvyutrpsqopqrstuvwxyz{|}~ghijklmndefabc]^_`YZ[\VWXOPQRSTUMNMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno3pqrstuvwxyz{|}~ None&'+-.01367;<=>?AFKLNQSTVh\MNOQPRSTUVWXYZ[\]^_`abcdefghijklmnoqsprtuyvwxz{|}~None&'+-.01367;<=>?AFKLNQSTVhj 0Optional SQL2008 "BIGINT data type" T071 support2Optional SQL2003 "NTH_VALUE function" T618 support COptional SQL2003 "FIRST_VALUE and LAST_VALUE function" T616 support 5Optional SQL2003 "LEAD and LAG function" T615 support.Optional SQL2003 "NTILE function" T614 support":Optional SQL2003 "Enhanced numeric functions" T621 support4>Optional SQL2003 "BINARY AND VARBINARY data type" T021 support7:Optional SQL2003 "Elementary OLAP operations" T611 support:8Optional SQL2003 "Advanced OLAP operations" T612 supportA:Optional SQL2003 "Elementary OLAP operations" T611 supportMNOQPRSTUVWXYZ[\]^_`abcdefghijklmnoqsprtuyvwxz{|}~      !"#$%&'()*+,-./0213456789:;<=>?@ABCDEFGCDEFABC>?@789:;<=456/0123,-.)*+"#$%&'( !     G      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFNone &'+-.01367;<=>?AFKLNQSTVhqHIJONMLKPRQSTUWVXYZ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ɯZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~XYUVWSTPQRJKLMNOHIHIJKLMNOPQRSTUVWXYZ%[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None&'+-.01367;<=>?AFKLNQSTVh=IA class that ties together a Sql syntax, backend, handle, and monad type.^Functional dependencies mean that only the backend type or the handle need to be specified.Intuitively, this allows you to write code that performs database commands without having to know the underlying API. As long as you have an appropriate handle from a database library that Beam can use, you can use the  methods to execute the query.LProvided here is a low-level interface. Most often, you'll only need the  and  function. The 'run*': functions are wrapped by the appropriate functions in .This interface is very high-level and isn't meant to expose the full power of the underlying database. Namely, it only supports simple data retrieval strategies. More complicated strategies (for example, Postgres's COPYg) are supported in individual backends. See the documentation of those backends for more details.fRun a database action, and log debugging information about statements executed using the specified r action. Run a query determined by the given syntax, providing an action that will be called to consume the results from the database (if any). The action will get a reader action that can be used to fetch the next row. When this reader action returns me, there are no rows left to consume. When the reader action returns, the database result is freed.!Run the given command and don't consume any results. Useful for DML statements like INSERT, UPDATE, and DELETE, or DDL statements."DRun the given command and fetch the unique result. The result is mJ if either no results are returned or more than one result is returned.#jRun the given command, collect all the results, and return them as a list. May be more convenient than  1, but reads the entire result set into memory.#Database statement logging functionBThe database connection handle against which to execute the actionThe database action The query to runGReader action that will be called with a function to fetch the next row 456789:;MNOQPRSTUVWXYZ[\]^_`abcdefghijklmnoqsprtuyvwxz{|}~      !"#$%&'()*+,-./0213456789:;<=>?@ABCDEFG !"# !"# !"# None&'+,-.01367;<=>?AFKLNQSTVh% The main syntax. A wrapper over s$%&'()*%&'$)*(tuvwx%&'None&'+-.01367;<=>?AFKLNQSTVh'  !"# !"# None&'+-.01367;<=>?AFKLNQSTVh VWXYZ[\]^_`ab^_c\]dZ[eXYVWf`abVWXYZ[\]^_ None&'+-.01367;<=>?AFKLNQSTVhG"j.Class to automatically unwrap nested NullablesyType-level representation of the naming strategy to use for defaulting Needed because primary keys should be named after the default naming of their corresponding table, not the names of the record selectors in the primary key (if any).vProvides a number of introspection routines for the beam library. Allows us to "zip" tables with different column tags together. Always instantiate an empty vk instance for tables, primary keys, and any type that you would like to embed within either. See the  3https://tathougies.github.io/beam/user-guide/modelsmanual& for more information on embedding.y5The 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 .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.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 Beamable BlogPostT instance Table BlogPostT where data PrimaryKey BlogPostT f = BlogPostId (Columnar f Text) deriving Generic primaryKey = BlogPostId . _blogPostSlug instance Beamable (PrimaryKey BlogPostT)!We can interpret this as follows:The  _blogPostSlug,  _blogPostBody,  _blogPostDate, and _blogPostTagline fields are of types z, z, UTCTime , and 'Maybe Text' respectfully.Since  _blogPostSlug,  _blogPostBody,  _blogPostDate, _blogPostAuthor, must be provided (i.e, they cannot contain m7), they will be given SQL NOT NULL constraints. _blogPostTagline is declared { so m) will be stored as NULL in the database. _blogPostImageGallery1 will be allowed to be empty because it uses the  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 m. See ).zA 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)| A form of table all fields }. Useful as a parameter to $ when you only care about one table.}!Column tag that ignores the type.FThe regular Haskell version of the table. Equivalent to 'tbl Identity'Represents a table that contains metadata on its fields. In particular, each field of type 'Columnar f a' is transformed into 'TableField table a'. You can get or update the name of each field by using the  lens.Metadata for a field of type ty in table.|Essentially a wrapper over the field name, but with a phantom type parameter, so that it forms an appropriate column tag.Usually you use the [ function to generate an appropriate naming convention for you, and then modify it with H if necessary. Under this scheme, the field can be renamed using the | instance for  , or the  function.The field namehIf you declare a function 'Columnar f a -> b' and try to constrain your function by a type class for f, GHC will complain, because f is ambiguous in 'Columnar f a'. For example, 'Columnar Identity (Maybe a) ~ Maybe a' and 'Columnar (Nullable Identity) a ~ Maybe a', so given a type 'Columnar f a', we cannot know the type of f.Thus, if you need to know f, you can instead use 0. Since its a newtype, it carries around the fG paramater unambiguously. Internally, it simply wraps 'Columnar f a'A short type-alias for %. May shorten your schema definitionsBA 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 Thus, any Beam table applied to [ will yield a simplified version of the data type, that contains just what you'd expect.The  type is used when referencing zPs that we want to include optionally. For example, if we have a table with a z, like the following }data BeamTableT f = BeamTableT { _refToAnotherTable :: PrimaryKey AnotherTableT f , ... }9we would typically be required to provide values for the z embedded into  BeamTableT. We can use  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 z in _refToAnotherTable0 automatically has its fields converted into { using . The last  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.When parameterized by this entity tag, a database type will hold meta-information on the Haskell mappings of database entities. Under the hood, each entity type is transformed into its R type. For tables this includes the table name as well as the corresponding ', which provides names for each column.Represents a meta-description of a particular entityType. Mostly, a wrapper around 'DatabaseEntityDescriptor be entityType', but carries around the  dictionary.4An entity tag for tables. See the documentation for y or consult the  3https://tathougies.github.io/beam/user-guide/modelsmanual for more.YA newtype wrapper around 'Columnar f a -> Columnar f ' (i.e., an endomorphism between s over f). You usually want to use  or the |7 instance to rename the field, when 'f ~ TableField'XA newtype wrapper around 'f e -> f e' (i.e., an endomorphism between entity types in f). You usually want to use 4 or another function to contstruct these for you.A helper data type that lets you modify a database schema. Converts all entities in the database into functions from that entity to itself.)Allows introspection into database types.VAll database types must be of kind '(* -> *) -> *'. If the type parameter is named f$, each field must be of the type of f& applied to some type for which an  instance exists.Entities are documented under  Database.Beam.Schema#entitiesthe corresponding section and in the 6http://tathougies.github.io/beam/user-guide/databases/manual9Default derived function. Do not implement this yourself.DThe idea is that, for any two databases over particular entity tags f and g, if we can take any entity in f and g# to the corresponding entity in h" (in the possibly effectful monad m3), then we can transform the two databases over f and g to a database in h, within the monad m.EIf that doesn't make sense, don't worry. This is mostly beam internalNAutomatically provide names for tables, and descriptions for tables (using  ). Your database must implement U, and must be auto-derivable. For more information on name generation, see the 3https://tathougies.github.io/beam/user-guide/modelsmanual Return a V that does nothing. This is useful if you only want to rename one table. You can do RdbModification { tbl1 = modifyTable (\oldNm -> "NewTableName") tableModification }*Return a table modification (for use with x) that does nothing. Useful if you only want to change the table name, or if you only want to modify a few fields. For example, (tableModification { field1 = "Column1" }Xis a table modification (where 'f ~ TableField tbl') that changes the column name of field1 to Column1.HModify a database according to a given modification. Most useful for z to change the name mappings of tables and fields. For example, you can use this to modify the default names of a table ,db :: DatabaseSettings MyDb db = defaultDbSettings `withDbModification` dbModification { -- Change default name "table1" to "Table_1". Change the name of "table1Field1" to "first_name" table1 = modifyTable (\_ -> "Table_1") (tableModification { table1Field1 = "first_name" } }IModify a table according to the given field modifications. Invoked by m to apply the modification in the database. Not used as often in user code, but provided for completeness. Provide an  for s. Allows you to modify the name of the table and provide a modification for each field in the table. See the examples for  for more.AA field modification to rename the field. Also offered under the |H instance for 'FieldModification (TableField tbl) a' for convenience.<Van Laarhoven lens to retrieve or set the field name from a . Synonym for { Return a  for the appropriate tableG type where each column has been given its default name. See the  3https://tathougies.github.io/beam/user-guide/modelsmanual5 for information on the default naming convention.}8Camel casing magic for standard beam record field names.nAll leading underscores are ignored. If what remains is camel-cased beam will convert it to use underscores instead. If there are any underscores in what remains, then the entire name (minus the leading underscares). If the field name is solely underscores, beam will assume you know what you're doing and include the full original name as the field nameOjklmnopqrstuvwxyz{|}~~O|}~opnmqrjklyz{vwwxxstujkyopqrstuvwwxxyz{}~~None&'+,-.01367;<=>?AFKLNQSTVhnS}Automatically deduce lenses for a table over any column tag. lenses at global level by doing a top-level pattern match on 9, replacing every column in the pattern with `LensFor  nameOfLensForFieldc'. The lenses are generated per-column, not per field in the record. Thus if you have nested v3 types, lenses are generated for each nested field. For example, Hdata 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 :: PrimaryKey AuthorT f , _blogPostTagline :: Columnar f (Maybe Text) } deriving Generic instance Table BlogPostT where data PrimaryKey BlogPostT f = BlogPostId (Columnar f Text) primaryKey = BlogPostId . _blogPostSlug instance Table AuthorT where data PrimaryKey AuthorT f = AuthorId (Columnar f Text) primaryKey = AuthorId . _authorEmail BlogPost (LensFor blogPostSlug (LensFor blogPostBody) (LensFor blogPostDate) (AuthorId (LensFor blogPostAuthorEmail)) (LensFor blogPostTagLine) = tableLensesoNote: In order to have GHC deduce the right type, you will need to turn off the monomorphism restriction. This is a part of the Haskell standard that specifies that top-level definitions must be inferred to have a monomorphic type. However, lenses need a polymorphic type to work properly. You can turn off the monomorphism restriction by enabling the NoMonomorphismRestriction7 extension. You can do this per-file by using the {-$ LANGUAGE NoMonomorphismRestriction ;-} pragma at the top of the file. You can also pass the -XNoMonomorphismRestriction0 command line flag to GHC during compilation.Like % but for types that are instances of $. Instead of pattern matching on , pattern match on . None&'+-.01367;<=>?AFKLNQSTVho#vyz{#yz{v None&'+-.01367;<=>?AFKLNQSTVh7Typeclass for all haskell data types that can be used to create a projection in a SQL select statement. This includes all tables as well as all tuple classes. Projections are only defined on tuples up to size 5. If you need more, follow the implementations here.2s represent expressions not containing aggregates.EThe type of lifted beam expressions that will yield the haskell type t.context^ is a type-level representation of the types of expressions this can contain. For example, < represents expressions that may contain aggregates, and , represents expressions that may contain OVER.syntaxI is the expression syntax being built (usually a type that implements o at least, but not always).s. is a state threading parameter that prevents s from incompatible sources to be combined. For example, this is used to prevent monadic joins from depending on the result of previous joins (so-called LATERAL joins).$&The type of queries over the database db returning results of type a. The sD argument is a threading argument meant to restrict cross-usage of s. syntax7 represents the SQL syntax that this query is building.M     ! "#$%&'(6543210/.-,+*)789:;<{87()*+,-./0123456'$%&#" ! A@    9:?>=BECDQPONMLKJIHGF]\[ZYXWVUTSRjihgfedcba`_^;<      !$%&()*+,-./0123456None&'+-.01367;<=>?AFKLNQSTVhguQConvenience functions to construct an arbitrary SQL92 select syntax type from a $:. Used by most backends as the default implementation of  buildSqlQuery in  HasQBuilder.uHWhether this backend supports arbitrary nested UNION, INTERSECT, EXCEPT  Table prefix uuNone&'+-.01367;<=>?AFKLNQSTVh  $vwx $x vwvwNone&'+-.01367;<=>?AFKLNQSTVh|{SQL AND operator|SQL OR operator}SQL LIKE operator~SQL99  SIMILAR TO operatorSQL NOT operatorSQL / operatorSQL % operatorSQL IS TRUE operatorSQL  IS NOT TRUE operatorSQL IS FALSE operatorSQL  IS NOT FALSE operatorSQL  IS UNKNOWN operatorSQL IS NOT UNKNOWN operatorSQL CONCAT function{|}~{3|2None&'+-.01367;<=>?AFKLNQSTVhQClass for things which can be  quantifiably compared._Class for expression types or expression containers for which there is a notion of ordering.Instances are provided to check the ordering of expressions of the same type. Since there is no universal notion of ordering for an arbitrary number of expressions, no instance is provided for v types.:Class for expression types for which there is a notion of  quantified equality._Class for expression types or expression containers for which there is a notion of equality.bInstances are provided to check the equality of expressions of the same type as well as entire v types parameterized over 5Given two expressions, returns whether they are equal9Given two expressions, returns whether they are not equalMA data structure representing the set to quantify a comparison operator over.A  representing a SQL ALL(..) for use with a #quantified-comparison-operatorquantified comparison operatorAccepts a subquery. Use  for an explicit listA  representing a SQL ALL(..) for use with a #quantified-comparison-operatorquantified comparison operator3Accepts an explicit list of typed expressions. Use  for a subqueryA  representing a SQL ANY(..) for use with a #quantified-comparison-operatorquantified comparison operatorAccepts a subquery. Use  for an explicit listA  representing a SQL ANY(..) for use with a #quantified-comparison-operatorquantified comparison operator3Accepts an explicit list of typed expressions. Use  for a subquerySQL BETWEEN clauseSQL IN predicateCompare two arbitrary v types containing s for equality.ACompare two arbitrary expressions (of the same type) for equalityDTwo arbitrary expressions can be quantifiably compared for equality. 444444444444None&'+-.01367;<=>?AFKLNQSTVh^GA type-class for expression syntaxes that can embed custom expressions.Given an arbitrary  , produce a syntax that represents the  as a SQL expression.Given an arbitrary syntax , produce a P that corresponds to how that syntax would look when rendered in the backend.Force a & to be typed as a value expression (a U). Useful for getting around type-inference errors with supplying the entire type.Force a R to be typed as an aggregate. Useful for defining custom aggregates for use in  aggregate_.None&'+-.01367;<=>?AFKLNQSTVh e.hType class for anything which can be checked for null-ness. This includes 'QExpr (Maybe a)' as well as ys or zs over 'Nullable QExpr'. Returns a ; that evaluates to true when the first argument is not null Returns a 7 that evaluates to true when the first argument is nullGiven an object (third argument) which may or may not be null, return the default value if null (first argument), or transform the value that could be null to yield the result of the expression (second argument)Type class for things that can be nullable. This includes 'QExpr (Maybe a)', 'tbl (Nullable QExpr)', and 'PrimaryKey tbl (Nullable QExpr)'Given something of type 'QExpr a', 'tbl QExpr', or 'PrimaryKey tbl QExpr', turn it into a 'QExpr (Maybe a)', 'tbl (Nullable QExpr)', or 'PrimaryKey t (Nullable QExpr)' respectively that contains the same values./Return either a 'QExpr (Maybe x)' representing m or a nullable y or z filled with m. Update a  or v type containing s with the given  or v type containing *Introduce all entries of a table into the $ monad)Introduce all entries of a view into the $ monad*Introduce all entries of a table into the $" monad based on the given QExprIntroduce a table using a left join with no ON clause. Because this is not an inner join, the resulting table is made nullable. This means that each field that would normally have type 'QExpr x' will now have type 'QExpr (Maybe x)'.Introduce a table using a left join. The ON clause is required here.Because this is not an inner join, the resulting table is made nullable. This means that each field that would normally have type 'QExpr x' will now have type 'QExpr (Maybe x)'.!Only allow results for which the  yields  Synonym for *clause >>= x -> guard_ (mkExpr x)>> pure xKIntroduce all entries of the given table which are referenced by the given z|Introduce all entries of the given table which for which the expression (which can depend on the queried table returns true) Generate an appropriate boolean \ comparing the given foreign key to the given table. Useful for creating join conditions.(Only return distinct values from a query0Limit the number of results returned by a query.Drop the first offset' results. Use the SQL EXISTS= operator to determine if the given query returns any results Use the SQL UNIQUEB operator to determine if the given query produces a unique resultUse the SQL99 DISTINCTD operator to determine if the given query produces a distinct resultLProject the (presumably) singular result of the given query as an expressionSQL  CHAR_LENGTH functionSQL  OCTET_LENGTH functionSQL  BIT_LENGTH functionSQL CURRENT_TIMESTAMP functionSQL POSITION(.. IN ..) function$Combine all the given boolean value  s with the { operator.HExtract an expression representing the current (non-UPDATEd) value of a SQL UNION operatorSQL  UNION ALL operatorSQL  INTERSECT operatorSQL  INTERSECT ALL operatorSQL EXCEPT operatorSQL  EXCEPT ALL operator\Convenience function that allows you to use type applications to specify the result of a .$Useful to disambiguate the types of Ms without having to provide a complete type signature. As an example, the  countAll_) aggregate can return a result of any J type. Without further constraints, the type is ambiguous. You can use ! to disambiguate the return type.For example, this is ambiguous aggregate_ (\_ -> countAll_) ..But this is not (aggregate_ (\_ -> as_ @Int countAll_) ..+Specify a window frame with all the optionsEProduce a window expression given an aggregate function and a window.Compute a query over windows.2The first function builds window frames using the , , etc functions. The return type can be a single frame, tuples of frame, or any arbitrarily nested tuple of the above. Instances up to 8-tuples are provided.The second function builds the resulting projection using the result of the subquery as well as the window frames built in the first function. In this function, window expressions can be included in the output using the  function.fOrder by the given expressions. The return type of the ordering key should either be the result of  or  (or another ordering h generated by a backend-specific ordering) or an (possibly nested) tuple of results of the former.The  =https://tathougies.github.io/beam/user-guide/queries/orderingmanual section has more information. Produce a  corresponding to a SQL ASC ordering Produce a  corresponding to a SQL DESC orderingSQL COALESCE support PARTITION BY  ORDER BY  RANGE / ROWS Window builder functionFProjection builder function. Has access to the windows generated aboveQuery to window overF4None&'+-.01367;<=>?AFKLNQSTVh6 mConvenience type to declare many-to-many relationships with additional data. See the manual section on  Bhttp://tathougies.github.io/beam/user-guide/queries/relationships/ relationships for more informationXConvenience type to declare many-to-many relationships. See the manual section on  Bhttp://tathougies.github.io/beam/user-guide/queries/relationships/ relationships for more informationsConvenience type to declare one-to-many relationships with a nullable foreign key. See the manual section on  Bhttp://tathougies.github.io/beam/user-guide/queries/relationships/ relationships for more information Synonym of ^. Useful for giving more meaningful types, when the relationship is meant to be one-to-one.WConvenience type to declare one-to-many relationships. See the manual section on  Bhttp://tathougies.github.io/beam/user-guide/queries/relationships/ relationships for more information Synonym of ^. Useful for giving more meaningful types, when the relationship is meant to be one-to-one.Used to define one-to-many (or one-to-one) relationships. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.Used to define one-to-many (or one-to-one) relationships. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.Used to define one-to-many (or one-to-one) relationships with a nullable foreign key. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.Used to define one-to-many (or one-to-one) relationships with a nullable foreign key. Takes the table to fetch, a way to extract the foreign key from that table, and the table to relate to.Used to define many-to-many relationships without any additional data. Takes the join table and two key extraction functions from that table to the related tables. Also takes two $+s representing the table sources to relate.See  Bhttp://tathougies.github.io/beam/user-guide/queries/relationships/ the manual for more indformation.Used to define many-to-many relationships with additional data. Takes the join table and two key extraction functions from that table to the related tables. Also takes two $+s representing the table sources to relate.See  Bhttp://tathougies.github.io/beam/user-guide/queries/relationships/ the manual for more indformation.Table to fetch (many)  Foreign key Table to fetch (many)  Foreign key Table to fetch  Foreign key Table to fetch  Foreign key None&'+-.01367;<=>?AFKLNQSTVhd=Type class for grouping keys. expr6 is the type of the grouping key after projection. groupeda is the type of the grouping key in the aggregate expression (usually something that contains  s in the )."Compute an aggregate over a query.The supplied aggregate projection should return an aggregate expression (an expression containing an aggregate function such as  ,  ,  +, etc), a grouping key (specified with the 7 function), or a combination of tuples of the above.2Appropriate instances are provided up to 8-tuples.SSemantically, all grouping expressions in the projection will be added to a SQL GROUP BY7 clause and all aggregate expressions will be computed.The return value will be the type of the aggregate projection, but transformed to be in the normal value context (i.e., everything will become s).For usage examples, see  @https://tathougies.github.io/beam/user-guide/queries/aggregates/ the manual.TCompute an aggregate over all values in a group. Corresponds semantically to the  AGG(ALL ..)) syntax, but doesn't produce an explicit ALL. To produce ALL expicitly, see .QCompute an aggregate only over distinct values in a group. Corresponds to the AGG(DISTINCT ..) syntax.GCompute an aggregate over all values in a group. Corresponds to the  AGG(ALL ..) syntax. Note that ALLS is the default for most aggregations, so you don't normally explicitly specify ALL. However, if you need to, you can use this function. To be explicit about quantification in the beam query DSL, but not produce an explicit ALL, use . D has the same semantic meaning, but does not produce an explicit ALL.SQL  MIN(ALL ..)( function (but without the explicit ALL)SQL  MAX(ALL ..)( function (but without the explicit ALL) SQL  AVG(ALL ..)( function (but without the explicit ALL) SQL  SUM(ALL ..)( function (but without the explicit ALL) SQL COUNT(*) function SQL  COUNT(ALL ..)( function (but without the explicit ALL) SQL2003  CUME_DIST: function (Requires T612 Advanced OLAP operations support)SQL2003  PERCENT_RANK: function (Requires T612 Advanced OLAP operations support)SQL2003 RANK< function (Requires T611 Elementary OLAP operations support)pSupport for FILTER (WHERE ...) syntax for aggregates. Part of SQL2003 Advanced OLAP operations feature (T612)SQL99  EVERY(ALL ..)( function (but without the explicit ALL)SQL99  SOME(ALL ..)( function (but without the explicit ALL)SQL99  ANY(ALL ..)( function (but without the explicit ALL) for any v type. Adds every field in the type to the grouping key. This is the equivalent of including the grouping expression of each field in the type as part of the aggregate projection for simple value expressions.Aggregate projectionQuery to aggregate over     None&'+-.01367;<=>?AFKLNQSTVhe0 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL,8None&'+-.01367;<=>?AFKLNQSTVhMRepresents a SQL DELETE statement for the given tableORepresents a SQL UPDATE statement for the given table.QORepresents a source of values that can be inserted into a table shaped like tbl.SRepresents a SQL INSERT" command that has not yet been runV.Represents a select statement over the syntax Z" that will return rows of type a.Y-A version of the table where each field is a ZBuild a V for the given $.[#Convenience function to generate a V2 that looks up a table row given a primary key.\Run a V in a  and get the results as a list]Run a V in a x and get the unique result, if there is one. Both no results as well as more than one result cause this to return m.^9Use a special debug syntax to print out an ANSI Standard SELECT0 statement that may be generated for a given $._ Generate a S& given a table and a source of values.`Run a S in a aBuild a Q from series of expressionsbBuild a Q from concrete table valuescBuild a Q from a V that returns the same tabledBuild a O? given a table, a list of assignments, and a way to build a WHERE clause.See the '(<-.)' operator for ways to build assignments. The argument to the second argument is a the table parameterized over , which represents the left hand side of assignments. Sometimes, you'd like to also get the current value of a particular column. You can use the  function to convert a  to a .e Generate a O7 that will update the given table with the given value.The SQL UPDATE} that is generated will set every non-primary key field for the row where each primary key field is exactly what is given.Note: This is a pure SQL UPDATE/ command. This does not upsert or merge values.fRun a O in a .gBuild a M# from a table and a way to build a WHERE clausehRun a M in a _Table to insert intoValues to insert. See b, a, and c for possibilities.dThe table to insert into"A sequence of assignments to make.Build a WHERE, clause given a table containing expressionseTable to updateValue to set togTable to delete fromBuild a WHERE, clause given a table containing expressions $vwx{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghUYX !"#$%&,'()*+-./0123456789:;=<>?@ABCDEFGIHJKL{|}~     VWZ[\]^ST_`QRabcOPdefMNghMNOPQRSTVWNone&'+-.01367;<=>?AFKLNQSTVhk{s that support returning the results of an insert statement. Useful for discovering the real value of a defaulted value._Unfortunately, SQL has no standard way of doing this, so it is provided as a beam extension.ijklklijijklNone&'+-.01367;<=>?AFKLNQSTVhN( vyz{ $vwx{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh  !"!#$%&'()*+,-./00123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTTUVVWWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeefghijklmnoopqrstuvwxyz{|}~      !"#$%&'()*+,-./012345678 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 j k k l l m m n n o p 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 rstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKKLLMMNNOPPQRSTUVWXYZ[\]^_`abcdefeghijklmnop q q r s t uvwxeyz{ | } ~                   nkl(beam-core-0.6.0.0-Feilgxv0XmtFKZRFFLjWiE Database.BeamDatabase.Beam.Backend.TypesDatabase.Beam.Backend.SQL.TypesDatabase.Beam.Backend.SQL.SQL92Database.Beam.Backend.SQL.SQL99!Database.Beam.Backend.SQL.SQL2003Database.Beam.Backend.SQL.ASTDatabase.Beam.Backend.SQL!Database.Beam.Backend.SQL.BuilderDatabase.Beam.Backend.URIDatabase.Beam.Schema.TablesDatabase.Beam.SchemaDatabase.Beam.Query.InternalDatabase.Beam.Query.SQL92Database.Beam.Query.TypesDatabase.Beam.QueryDatabase.Beam.Query.CustomSQL(Database.Beam.Backend.SQL.BeamExtensionsQueryDatabase.Beam.BackendDatabase.Beam.Schema.LensesDatabase.Beam.Query.OperatorDatabase.Beam.Query.OrdDatabase.Beam.Query.Combinators!Database.Beam.Query.RelationshipsDatabase.Beam.Query.AggregateDatabase.Beam.Query.ExtensionsbaseData.Typeable.InternalTypeable GHC.GenericsGenericControl.Monad.IO.ClassliftIOMonadIOData.Functor.IdentityIdentityNullableExposedFromBackendRowfromBackendRow valuesNeededFromBackendRowMFromBackendRowF ParseOneField PeekFieldCheckNextNNullAutounAuto BeamBackendBackendFromField parseOneField peekFieldcheckNextNNull $fToJSONAuto$fFromJSONAuto$fFromBackendRowbeAuto$fFromBackendRowbeMaybe$fFromBackendRowbeVector$fFromBackendRowbetbl$fFromBackendRowbetbl0$fFromBackendRowbe(,,,,,,,)$fFromBackendRowbe(,,,,,,)$fFromBackendRowbe(,,,,,)$fFromBackendRowbe(,,,,)$fFromBackendRowbe(,,,)$fFromBackendRowbe(,,)$fFromBackendRowbe(,)$fFromBackendRowbe()$fGFromBackendRowbeK1K1$fGFromBackendRowbeK1K10$fGFromBackendRowbeK1K11$fGFromBackendRowbe:*::*:$fGFromBackendRowbeeU1$fGFromBackendRowbeM1M1 $fShowAuto $fReadAuto$fEqAuto $fOrdAuto $fGenericAuto $fMonoidAuto$fGeneric(,,,,,,,)$fFunctorFromBackendRowF SqlSerialunSerial SqlBitStringSqlNullBeamSqlBackend$fToJSONSqlSerial$fFromJSONSqlSerial$fFromBackendRowbeSqlSerial $fShowSqlNull $fEqSqlNull $fOrdSqlNull$fBoundedSqlNull $fEnumSqlNull$fShowSqlBitString$fEqSqlBitString$fOrdSqlBitString$fEnumSqlBitString$fBitsSqlBitString$fShowSqlSerial$fReadSqlSerial $fEqSqlSerial$fOrdSqlSerialIsSql92FromOuterJoinSyntax outerJoinIsSql92FromSyntaxSql92FromTableSourceSyntaxSql92FromExpressionSyntax fromTable innerJoinleftJoin rightJoinIsSql92GroupingSyntaxSql92GroupingExpressionSyntaxgroupByExpressionsIsSql92TableSourceSyntaxSql92TableSourceSelectSyntax tableNamedtableFromSubSelectIsSql92OrderingSyntaxSql92OrderingExpressionSyntax ascOrdering descOrderingIsSql92ProjectionSyntaxSql92ProjectionExpressionSyntax projExprs%IsSql92AggregationSetQuantifierSyntaxsetQuantifierDistinctsetQuantifierAll"IsSql92AggregationExpressionSyntax#Sql92AggregationSetQuantifierSyntax countAllEcountEavgEmaxEminEsumEIsSql92ExpressionSyntaxSql92ExpressionQuantifierSyntaxSql92ExpressionValueSyntaxSql92ExpressionSelectSyntaxSql92ExpressionFieldNameSyntaxSql92ExpressionCastTargetSyntax!Sql92ExpressionExtractFieldSyntaxvalueErowE coalesceEcaseEfieldEbetweenEandEorEaddEsubEmulEdivElikeEmodE overlapsEnullIfE positionEeqEneqEltEgtEleEgeEcastEnotEnegateEisNullE isNotNullEisTrueE isNotTrueEisFalseE isNotFalseE isUnknownE isNotUnknownE charLengthE octetLengthE bitLengthEabsEextractEexistsEuniqueE subqueryEcurrentTimestampEdefaultEinEIsSql92DataTypeSyntax domainTypecharType varCharTypenationalCharTypenationalVarCharTypebitType varBitType numericType decimalTypeintType smallIntType floatType doubleTyperealTypedateTypetimeType timestampTypeIsSql92QuantifierSyntaxquantifyOverAllquantifyOverAnyIsSql92FieldNameSyntaxqualifiedFieldunqualifiedFieldIsSql92DeleteSyntaxSql92DeleteExpressionSyntax deleteStmtIsSql92UpdateSyntaxSql92UpdateFieldNameSyntaxSql92UpdateExpressionSyntax updateStmtIsSql92InsertValuesSyntax!Sql92InsertValuesExpressionSyntaxSql92InsertValuesSelectSyntaxinsertSqlExpressions insertFromSqlIsSql92InsertSyntaxSql92InsertValuesSyntax insertStmtIsSql92SelectTableSyntaxSql92SelectTableSelectSyntax Sql92SelectTableExpressionSyntax Sql92SelectTableProjectionSyntaxSql92SelectTableFromSyntaxSql92SelectTableGroupingSyntax#Sql92SelectTableSetQuantifierSyntaxselectTableStmt unionTablesintersectTables exceptTableIsSql92SelectSyntaxSql92SelectSelectTableSyntaxSql92SelectOrderingSyntax selectStmt IsSql92SyntaxSql92SelectSyntaxSql92InsertSyntaxSql92UpdateSyntaxSql92DeleteSyntax selectCmd insertCmd updateCmd deleteCmdSql92ReasonableMarshallerSql92SanityCheckSql92SelectSanityCheckSql92HasValueSyntaxSql92ExpressionSyntaxSql92ValueSyntaxSql92SelectFromSyntaxSql92SelectGroupingSyntaxSql92SelectProjectionSyntaxSql92SelectExpressionSyntaxIsSqlExpressionSyntaxStringTypeHasSqlValueSyntaxsqlValueSyntaxBeamSql92BackendautoSqlValueSyntax"$fHasSqlValueSyntaxsyntaxSqlSerialIsSql99DataTypeSyntaxcharacterLargeObjectTypebinaryLargeObjectType booleanType arrayTyperowType"IsSql99AggregationExpressionSyntaxeveryEsomeEanyEIsSql99ConcatExpressionSyntaxconcatEIsSql99ExpressionSyntax distinctE similarToE functionCallEinstanceFieldE refFieldEIsSql99SelectSyntaxIsSql2008BigIntDataTypeSyntax bigIntType!IsSql2003NthValueExpressionSyntax nthValueE/IsSql2003FirstValueAndLastValueExpressionSyntax firstValueE lastValueE#IsSql2003LeadAndLagExpressionSyntaxleadElagEIsSql2003NtileExpressionSyntaxntileE*.<=*.>=*.SqlOrd<.>.<=.>=.SqlEqQuantified==*./=*.SqlEq==./=. QQuantifiedallOf_allIn_anyOf_anyIn_between_in_IsCustomExprFn customExpr_IsCustomSqlSyntaxCustomSqlSyntaxcustomExprSyntax renderSyntax valueExpr_agg_#$fIsCustomSqlSyntaxSqlSyntaxBuilder$fIsStringCustomSqlSnippet$fMonoidCustomSqlSnippet$fIsCustomExprFn(->)(->)($fIsCustomExprFnCustomSqlSnippetQGenExpr$fIsStringCustomSqlSyntax$fMonoidCustomSqlSyntaxSqlDeconstructMaybeisJust_ isNothing_maybe_QIfElseQIfCond SqlJustablejust_nothing_ SqlOrderable SqlValableval_SqlValableTableHaskellLiteralForQExpr<-.all_ allFromView_join_perhaps_ outerJoin_ leftJoin_ subselect_guard_filter_related_ relatedBy_ references_nub_limit_offset_exists_unique_ distinct_ subquery_ charLength_ octetLength_ bitLength_currentTimestamp_ position_current_union_ unionAll_ intersect_ intersectAll_except_ exceptAll_as_default_auto_ noBounds_ fromBound_bounds_ unbounded_nrows_noOrder_ noPartition_ partitionBy_orderPartitionBy_frame_over_ withWindow_orderBy_ nullsFirst_ nullsLast_asc_desc_then_else_if_ coalesce_ManyToManyThrough ManyToManyOneToManyOptional OneToMaybe OneToManyOneToOne oneToMany_ oneToOne_oneToManyOptional_ oneToMaybe_ manyToMany_manyToManyPassthrough_ QGroupablegroup_ aggregate_ allInGroup_distinctInGroup_allInGroupExplicitly_min_max_avg_sum_ countAll_count_ cumeDist_ percentRank_ denseRank_rank_minOver_maxOver_avgOver_sumOver_ countOver_ everyOver_ someOver_anyOver_ filterWhere_every_some_any_ntile_lead1_lag1_lead_lag_leadWithDefault_lagWithDefault_ firstValue_ lastValue_ nthValue_ln_exp_sqrt_ceiling_floor_**.stddevPopOver_stddevSampOver_ varPopOver_ varSampOver_ stddevPop_ stddevSamp_varPop_varSamp_ covarPopOver_covarSampOver_ corrOver_regrSlopeOver_regrInterceptOver_regrCountOver_regrRSquaredOver_ regrAvgYOver_ regrAvgXOver_ regrSXXOver_ regrSYYOver_ regrSXYOver_ covarPop_ covarSamp_corr_ regrSlope_regrIntercept_ regrCount_ regrRSquared_ regrAvgY_ regrAvgX_regrSXX_regrSYY_regrSXY_ SqlDelete SqlUpdateSqlInsertValues SqlInsertQueryableSqlSyntax SqlSelect QExprTable QGenExprTableselectlookuprunSelectReturningListrunSelectReturningOne dumpSqlSelectinsert runInsertinsertExpressions insertFromupdatesave runUpdatedelete runDeleteMonadBeamUpdateReturningrunUpdateReturningListMonadBeamInsertReturningrunInsertReturningListGHC.BaseNothingJustGFromBackendRowgFromBackendRow gValuesNeededghc-prim GHC.TypesIObytestring-0.10.8.2 Data.ByteString.Builder.InternalBuilder SqlSyntaxMSqlWindowFrameBoundSqlWindowFrameUnboundedSqlWindowFrameBoundedSubTableStrategy#text-1.2.2.2-EakMpasry3jA6OIwSZhq9MData.Text.InternalTextMaybe Data.StringIsStringunCamelCaseSel DatabaseTable DatabaseViewDatabaseDomainTypeGTableSkeleton gTblSkeletonSubTableStrategyImpl namedSubTablePrimaryKeyStrategyBeamableStrategyRecursiveKeyStrategyGDefaultTableFieldSettingsgDefTblFieldSettings GZipTables gZipTables GZipDatabase gZipDatabaseGAutoDbSettingsautoDbSettings'/D:R:DatabaseEntityDescriptorbeDomainTypeEntity0)D:R:DatabaseEntityDescriptorbeViewEntity0*D:R:DatabaseEntityDescriptorbeTableEntity0GDatabaseLensesgDatabaseLenses GTableLenses gTableLenses SelectBuilderSelectBuilderQSelectBuilderGroupingSelectBuilderSelectSyntaxSelectBuilderTopLevelsbLimitsbOffset sbOrderingsbTable QueryBuilder qbNextTblRefqbFromqbWhere$fSqlEqQGenExprtbl0$fSqlEqQGenExprQGenExpr,$fSqlEqQuantifiedQGenExprQQuantifiedQGenExprData.ByteString.Internal ByteStringCustomSqlSnippet$D:R:CustomSqlSyntaxSqlSyntaxBuilder0SqlSyntaxBuilderCustomTrueallEGHC.RealIntegralmakeSQLOrdering SqlUpdatable$fQGroupabletbltbl$fQGroupableQGenExprQGenExpr