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]
- 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 # | |
Data ColumnProp Source # | |
Defined in Database.Persist.Migration.Operation.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ColumnProp -> c ColumnProp # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ColumnProp # toConstr :: ColumnProp -> Constr # dataTypeOf :: ColumnProp -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ColumnProp) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColumnProp) # gmapT :: (forall b. Data b => b -> b) -> ColumnProp -> ColumnProp # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ColumnProp -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ColumnProp -> r # gmapQ :: (forall d. Data d => d -> u) -> ColumnProp -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ColumnProp -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ColumnProp -> m ColumnProp # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ColumnProp -> m ColumnProp # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ColumnProp -> m ColumnProp # | |
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
getConstraintColumns :: TableConstraint -> [Text] Source #
Get the columns defined in the given TableConstraint.
Orphan instances
Data PersistValue Source # | |
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PersistValue -> c PersistValue # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PersistValue # toConstr :: PersistValue -> Constr # dataTypeOf :: PersistValue -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PersistValue) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PersistValue) # gmapT :: (forall b. Data b => b -> b) -> PersistValue -> PersistValue # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PersistValue -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PersistValue -> r # gmapQ :: (forall d. Data d => d -> u) -> PersistValue -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PersistValue -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PersistValue -> m PersistValue # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PersistValue -> m PersistValue # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PersistValue -> m PersistValue # |