Skip to content

Commit

Permalink
feat: add default_timestamp option
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-Q committed Mar 20, 2023
1 parent 846d642 commit 6ba8901
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ module.exports = grammar({
keyword_recursive: _ => make_keyword("recursive"),
keyword_cascaded: _ => make_keyword("cascaded"),
keyword_local: _ => make_keyword("local"),
keyword_current_timestamp: _ => make_keyword("current_timestamp"),

// Hive Keywords
keyword_external: _ => make_keyword("external"),
Expand Down Expand Up @@ -1251,6 +1252,7 @@ module.exports = grammar({
$.unary_expression,
$.array,
$.invocation,
$.keyword_current_timestamp,
alias($.implicit_cast, $.cast),
),

Expand Down
6 changes: 6 additions & 0 deletions test/corpus/create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ CREATE TABLE type_test (
a_timestamp TIMESTAMP,
a_verbose_timestamp TIMESTAMP WITHOUT TIME ZONE,
a_tstz TIMESTAMPTZ,
a_date_with_default_ts DATETIME DEFAULT CURRENT_TIMESTAMP,
a_verbose_tstz TIMESTAMP WITH TIME ZONE,
a_geometry GEOMETRY,
a_geography GEOGRAPHY,
Expand Down Expand Up @@ -938,6 +939,11 @@ CREATE TABLE type_test (
(column_definition
name: (identifier)
type: (keyword_timestamptz))
(column_definition
name: (identifier)
type: (keyword_datetime)
(keyword_default)
(keyword_current_timestamp))
(column_definition
name: (identifier)
type: (keyword_timestamptz))
Expand Down

0 comments on commit 6ba8901

Please sign in to comment.