Maintainer | Brandon Chinn <brandonchinn178@gmail.com> |
---|---|
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Defines auxiliary data types that can be used in Operations.
Synopsis
- type ColumnIdentifier = (Text, Text)
- dotted :: ColumnIdentifier -> Text
- data Column = Column {}
- validateColumn :: Column -> Either String ()
- data ColumnProp
- data TableConstraint
- = PrimaryKey [Text]
- | Unique Text [Text]
- isPrimaryKey :: TableConstraint -> Bool
- getConstraintColumns :: TableConstraint -> [Text]
Documentation
type ColumnIdentifier = (Text, Text) Source #
A column identifier, table.column
dotted :: ColumnIdentifier -> Text Source #
Make a ColumnIdentifier displayable.
The definition for a Column in a SQL database.
data ColumnProp Source #
A property for a Column
.
NotNull | Makes a column non-nullable (defaults to nullable) |
References ColumnIdentifier | Mark this column as a foreign key to the given column |
AutoIncrement | Makes a column auto-incrementing |
Default PersistValue | Sets the default value for the column. Note that this doesn't matter when inserting data via Haskell; this property only sets the schema in the SQL backend. See More info: https://www.yesodweb.com/book/persistent#persistent_attributes |
Instances
Eq ColumnProp Source # | |
Defined in Database.Persist.Migration.Operation.Types (==) :: ColumnProp -> ColumnProp -> Bool # (/=) :: ColumnProp -> ColumnProp -> Bool # | |
Show ColumnProp Source # | |
Defined in Database.Persist.Migration.Operation.Types showsPrec :: Int -> ColumnProp -> ShowS # show :: ColumnProp -> String # showList :: [ColumnProp] -> ShowS # |
data TableConstraint Source #
Table constraints in a CREATE query.
PrimaryKey [Text] | PRIMARY KEY (col1, col2, ...) |
Unique Text [Text] | CONSTRAINT name UNIQUE (col1, col2, ...) |
Instances
Show TableConstraint Source # | |
Defined in Database.Persist.Migration.Operation.Types showsPrec :: Int -> TableConstraint -> ShowS # show :: TableConstraint -> String # showList :: [TableConstraint] -> ShowS # |
isPrimaryKey :: TableConstraint -> Bool Source #
getConstraintColumns :: TableConstraint -> [Text] Source #
Get the columns defined in the given TableConstraint.