diff --git a/Language/SQL/SimpleSQL/Parse.lhs b/Language/SQL/SimpleSQL/Parse.lhs index ba5f684..82cd780 100644 --- a/Language/SQL/SimpleSQL/Parse.lhs +++ b/Language/SQL/SimpleSQL/Parse.lhs @@ -1564,8 +1564,9 @@ TODO: change style > colConstraintDef = > ColConstraintDef > <$> (optionMaybe (keyword_ "constraint" *> names)) -> <*> (notNull <|> unique <|> primaryKey <|> check <|> references) +> <*> (nullable <|> notNull <|> unique <|> primaryKey <|> check <|> references) > where +> nullable = ColNullableConstraint <$ keyword "null" > notNull = ColNotNullConstraint <$ keywords_ ["not", "null"] > unique = ColUniqueConstraint <$ keyword_ "unique" > primaryKey = ColPrimaryKeyConstraint <$ keywords_ ["primary", "key"] diff --git a/Language/SQL/SimpleSQL/Syntax.lhs b/Language/SQL/SimpleSQL/Syntax.lhs index 22d61c8..3dfd440 100644 --- a/Language/SQL/SimpleSQL/Syntax.lhs +++ b/Language/SQL/SimpleSQL/Syntax.lhs @@ -571,7 +571,8 @@ I'm not sure if this is valid syntax or not. > deriving (Eq,Show,Read,Data,Typeable) > data ColConstraint = -> ColNotNullConstraint +> ColNullableConstraint +> | ColNotNullConstraint > | ColUniqueConstraint > | ColPrimaryKeyConstraint > | ColReferencesConstraint [Name] (Maybe Name)