| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.Beam.SQL
- ppSQL :: SQLCommand -> (String, [SqlValue])
- noConstraints :: SqlColDesc -> SQLColumnSchema
- notNull :: SqlColDesc -> SQLColumnSchema
- data SQLCommand
- data SQLCreateTable = SQLCreateTable {
- ctTableName :: Text
- ctFields :: [(Text, SQLColumnSchema)]
- data SQLColumnSchema = SQLColumnSchema {}
- data SQLConstraint
- data SQLInsert = SQLInsert {
- iTableName :: Text
- iValues :: [SqlValue]
- data SQLUpdate = SQLUpdate {
- uTableNames :: [Text]
- uAssignments :: [(SQLFieldName, SQLExpr)]
- uWhere :: Maybe SQLExpr
- data SQLDelete = SQLDelete {
- dTableName :: Text
- dWhere :: Maybe SQLExpr
- data SQLSelect = SQLSelect {}
- data SQLFieldName
- data SQLAliased a = SQLAliased a (Maybe Text)
- data SQLProjection
- data SQLSource
- data SQLJoinType
- data SQLFrom
- data SQLGrouping = SQLGrouping {
- sqlGroupBy :: [SQLExpr]
- sqlHaving :: SQLExpr
- data SQLOrdering
- data SQLExpr' f
- type SQLExpr = SQLExpr' SQLFieldName
SQL pretty printing
ppSQL :: SQLCommand -> (String, [SqlValue]) Source
Convert a SQLCommand 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.
Untyped SQL types
SQL queries
data SQLCommand Source
Constructors
| Select SQLSelect | |
| Insert SQLInsert | |
| Update SQLUpdate | |
| Delete SQLDelete | |
| CreateTable SQLCreateTable |
Instances
data SQLCreateTable Source
Constructors
| SQLCreateTable | |
Fields
| |
Instances
data SQLColumnSchema Source
Constructors
| SQLColumnSchema | |
Fields
| |
Instances
Constructors
| SQLInsert | |
Fields
| |
Constructors
| SQLUpdate | |
Fields
| |
Constructors
| SQLSelect | |
Fields
| |
data SQLAliased a Source
Constructors
| SQLAliased a (Maybe Text) |
Instances
| Show a => Show (SQLAliased a) Source |
data SQLProjection Source
Constructors
| SQLProjStar | The * from SELECT * |
| SQLProj [SQLAliased SQLExpr] |
Instances
Constructors
| SQLSourceTable Text | |
| SQLSourceSelect SQLSelect |
Constructors
| SQLFromSource (SQLAliased SQLSource) | |
| SQLJoin SQLJoinType SQLFrom SQLFrom SQLExpr |
data SQLGrouping Source
Constructors
| SQLGrouping | |
Fields
| |
Instances
type SQLExpr = SQLExpr' SQLFieldName Source