0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Support for PostgreSQL serial

This commit is contained in:
rbock 2017-03-05 19:13:26 +01:00
parent 8255d3e3b2
commit e53bbcc9bd

View File

@ -169,7 +169,12 @@ ddlName = Or([ddlTerm, ddlString])
ddlArguments = "(" + delimitedList(Or([ddlString, ddlTerm, ddlNum])) + ")" ddlArguments = "(" + delimitedList(Or([ddlString, ddlTerm, ddlNum])) + ")"
ddlNotNull = Group(ddlWord("NOT") + ddlWord("NULL")).setResultsName("notNull") ddlNotNull = Group(ddlWord("NOT") + ddlWord("NULL")).setResultsName("notNull")
ddlDefaultValue = ddlWord("DEFAULT").setResultsName("hasDefaultValue") ddlDefaultValue = ddlWord("DEFAULT").setResultsName("hasDefaultValue")
ddlAutoValue = ddlWord("AUTO_INCREMENT").setResultsName("hasAutoValue") ddlAutoValue = Or([
ddlWord("AUTO_INCREMENT"),
ddlWord("SMALLSERIAL"),
ddlWord("SERIAL"),
ddlWord("BIGSERIAL"),
]).setResultsName("hasAutoValue")
ddlColumnComment = Group(ddlWord("COMMENT") + ddlString).setResultsName("comment") ddlColumnComment = Group(ddlWord("COMMENT") + ddlString).setResultsName("comment")
ddlConstraint = Or([ ddlConstraint = Or([
ddlWord("CONSTRAINT"), ddlWord("CONSTRAINT"),
@ -192,9 +197,12 @@ ddl.ignore(ddlComment)
types = { types = {
'tinyint': 'tinyint', 'tinyint': 'tinyint',
'smallint': 'smallint', 'smallint': 'smallint',
'smallserial': 'smallint', # PostgreSQL
'integer': 'integer', 'integer': 'integer',
'int': 'integer', 'int': 'integer',
'serial': 'integer', # PostgreSQL
'bigint': 'bigint', 'bigint': 'bigint',
'bigserial': 'bigint', # PostgreSQL
'char': 'char_', 'char': 'char_',
'varchar': 'varchar', 'varchar': 'varchar',
'text': 'text', 'text': 'text',