generic-persistence-0.4.0.0: Database persistence using generics
Safe HaskellSafe-Inferred
LanguageGHC2021

Database.GP.SqlGenerator

Synopsis

Documentation

insertStmtFor :: forall a. Entity a => String Source #

This module defines some basic SQL statements for Record Data Types that are instances of Entity. The SQL statements are generated using Haskell generics to provide compile time reflection capabilities.

A function that returns an SQL insert statement for an entity. Type a must be an instance of Data. The function will use the field names of the data type to generate the column names in the insert statement. The values of the fields will be used as the values in the insert statement. Output example: INSERT INTO Person (id, name, age, address) VALUES (123456, Alice, 25, "123 Main St");

updateStmtFor :: forall a. Entity a => String Source #

A function that returns an SQL update statement for an entity. Type a must be an instance of Entity.

selectFromStmt :: forall a. Entity a => WhereClauseExpr -> String Source #

A function that returns an SQL select statement for an entity. Type a must be an instance of Entity. The function takes a where clause expression as parameter. This expression is used to filter the result set.

deleteStmtFor :: forall a. Entity a => String Source #

data Field Source #

Instances

Instances details
Show Field Source # 
Instance details

Defined in Database.GP.Query

Methods

showsPrec :: Int -> Field -> ShowS #

show :: Field -> String #

showList :: [Field] -> ShowS #

Eq Field Source # 
Instance details

Defined in Database.GP.Query

Methods

(==) :: Field -> Field -> Bool #

(/=) :: Field -> Field -> Bool #

in' :: Convertible b SqlValue => Field -> [b] -> WhereClauseExpr infixl 4 Source #