Frames-beam-0.2.0.0: A library for accessing Postgres tables as in-memory data structures.

Safe HaskellNone
LanguageHaskell2010

Frames.SQL.Beam.Postgres.Query

Description

This module provides certain "canned" queries that would be useful for pulling Postgres rows into a data frame. Also contains a utility function for handling results of join queries.

Synopsis

Documentation

allRows :: (Database Postgres b, Table a) => PostgresTable a b -> PostgresDB b -> Q PgSelectSyntax b s (a (QExpr PgExpressionSyntax s)) Source #

Helps select all rows from a particular table in a database. Note that the table and database declaration is present in the module generated by genBeamSchema, invoked in the end-user code. Equivalent to SQL: "SELECT * FROM tbl;" when run using an appropriate run function from the FramesBeam.Streaming module.

allRowsWhere :: (Database Postgres b, Table a) => PostgresTable a b -> PostgresDB b -> PostgresFilterLambda a s -> Q PgSelectSyntax b s (a (QExpr PgExpressionSyntax s)) Source #

Helps select all rows from a particular table in a database that satisfy a certain filter condition that is executed at the DB-level. Note that the table and database declaration is present in the module generated by genBeamSchema, invoked in the end-user code. Equivalent to SQL: "SELECT * FROM tbl WHERE ...;" when run using an appropriate run function from the FramesBeam.Streaming module.

join2 :: (Table a, Table b, GenericVinyl (a Identity) a_names a_rs, GenericVinyl (b Identity) b_names b_rs, RecVec (ZipTypes a_names a_rs), RecVec (ZipTypes b_names b_rs)) => JoinQueryResults a b -> FrameRec (ZipTypes a_names a_rs ++ ZipTypes b_names b_rs) Source #

Function for creating a data frame from the results of executing a join query.