Sha256: 88020911c222d18e8a3c95de66ab1b51316c62fee291fa079435411ce0b26b39
Contents?: true
Size: 978 Bytes
Versions: 6
Compression:
Stored size: 978 Bytes
Contents
grammar SQLCreateTable include SQLRowSupport include SQLDataTypes rule create_table "CREATE" SPACE+ "TABLE" SPACE+ table_name SPACE+ OPEN_PARENS columns_and_datatypes CLOSE_PARENS { def eval options = { :columns => columns_and_datatypes.eval, :table_name => table_name.eval } options end def query_type :create_table end def tree values = eval { :table => values[:table_name], :columns => values[:columns] } end } end rule columns_and_datatypes column_with_datatype COMMA columns_and_datatypes { def eval all = column_with_datatype.eval + columns_and_datatypes.eval all.flatten! all end } / column_with_datatype end rule column_with_datatype SPACE* column_name SPACE+ datatype SPACE* { def eval [column_name.eval] end } end end
Version data entries
6 entries across 6 versions & 1 rubygems