| Copyright | Flipstone Technology Partners 2023 |
|---|---|
| License | MIT |
| Stability | Stable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Orville.PostgreSQL.Expr.ColumnDefinition
Description
Since: 1.0.0.0
Synopsis
Documentation
data ColumnDefinition Source #
Represent a complete definition of a column. E.G.
foo INTEGER
ColumnDefinition provides a SqlExpression instance. See
unsafeSqlExpression for how to construct a value with your own custom
SQL.
Since: 1.0.0.0
Instances
| SqlExpression ColumnDefinition Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.ColumnDefinition Methods toRawSql :: ColumnDefinition -> RawSql Source # | |
Arguments
| :: ColumnName | The name the resulting column should have. |
| -> DataType | The SQL type of the column. |
| -> Maybe ColumnConstraint | The constraint on the column, if any. |
| -> Maybe ColumnDefault | The default value for the column, if any. |
| -> ColumnDefinition |
Smart constructor for ensuring a ColumnDefinition is set up correctly.
Since: 1.0.0.0
data ColumnConstraint Source #
Represent constraints, such as nullability, on a column. E.G.
NOT NULL
ColumnConstraint provides a SqlExpression instance. See
unsafeSqlExpression for how to construct a value with your own custom
SQL.
Since: 1.0.0.0
Instances
| SqlExpression ColumnConstraint Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.ColumnDefinition Methods toRawSql :: ColumnConstraint -> RawSql Source # | |
notNullConstraint :: ColumnConstraint Source #
Express that a column may not contain NULL.
Since: 1.0.0.0
nullConstraint :: ColumnConstraint Source #
Express that a column may contain NULL.
Since: 1.0.0.0
data ColumnDefault Source #
Represents the default value of a column. E.G.
now()
ColumnDefault provides' a SqlExpression instance. See
unsafeSqlExpression for how to construct a value with your own custom
SQL.
Since: 1.0.0.0
Instances
| SqlExpression ColumnDefault Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.ColumnDefinition Methods toRawSql :: ColumnDefault -> RawSql Source # | |
columnDefault :: ValueExpression -> ColumnDefault Source #
Given a ValueExpression, use that as a ColumnDefault. This is the preferred path to creating a
column default. Note that it is up to the caller to ensure the ValueExpression makes sense for
the resulting ColumnDefinition this will be a part of.
Since: 1.0.0.0