Skip to content

Commit

Permalink
chore(embedded/sql): support parenthesis as datatype constraint delim…
Browse files Browse the repository at this point in the history
…iter

Signed-off-by: Jeronimo Irazabal <jeronimo.irazabal@gmail.com>
  • Loading branch information
jeroiraz committed Sep 14, 2023
1 parent d192b55 commit 78bef35
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 231 deletions.
2 changes: 1 addition & 1 deletion embedded/sql/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func TestCreateTableStmt(t *testing.T) {
expectedError: nil,
},
{
input: "CREATE TABLE table1 (id INTEGER, name VARCHAR[50], ts TIMESTAMP, active BOOLEAN, content BLOB, PRIMARY KEY (id, name))",
input: "CREATE TABLE table1 (id INTEGER, name VARCHAR(50), ts TIMESTAMP, active BOOLEAN, content BLOB, PRIMARY KEY (id, name))",
expectedOutput: []SQLStmt{
&CreateTableStmt{
table: "table1",
Expand Down
5 changes: 5 additions & 0 deletions embedded/sql/sql_grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ opt_max_len:
{
$$ = $2
}
|
'(' INTEGER ')'
{
$$ = $2
}

opt_auto_increment:
{
Expand Down
Loading

0 comments on commit 78bef35

Please sign in to comment.