-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres support (basic syntax) #42
Comments
Not sure if listing out missing features is wanted in this issue, but I saw on SQL Explorer that CREATE TABLE users ( created_at timestamp DEFAULT now() );
Maybe this is already covered under |
Well, always good to have examples of not supported code. Don't really know what the issue might be in here. Possibly indeed related to Postgres keyword handling. |
@karlhorky FYI, this error happens currently because the DEFAULT value implementation is based on the existing SQLite and BigQuery implementation. In these dialects only literal values or a parenthesized expression can be used as default value. So the following parses fine: CREATE TABLE users ( created_at timestamp DEFAULT (now()) ); |
Thanks for your work on this! I've been experimenting with the Prettier plugin using this parser and overall it's been great.
In PostgreSQL, parameters are typically referred to by position number instead of by name (docs) -- would it be possible to add a |
Yeah, that should be simple to add. |
@jming422 Should be available in 0.27.1 release. |
Woah, thank you, you rock! 🚀 |
Also pushed a new prettier plugin release. |
Basic syntax
AS
alias names-- foo
/* blah */
/* foo /*blah*/ bar */
#
-comments$
."foo bar"
U&"d\0061t\+000061"
U&"d!0061t!+000061" UESCAPE '!'
'foo''bar'
'foo'\n'bar'
(but not'foo' 'bar'
, must have at least on\n
, then any number of spaces can also be included. Can also include line comments, but no block comments.)E'foo\nbar'
\b
,\f
,\n
,\r
,\t
\o
,\oo
,\ooo
\xh
,\xhh
\uxxxx
,\Uxxxxxxxx
\'
and''
,U&'d\0061t\+000061'
U&'d!0061t!+000061' UESCAPE '!'
$$foo bar$$
$SomeTag$Dianne's horse$SomeTag$
B'1001
orb'0110'
X'1FA'
orx'1FA'
0xFFFF
0o666
0b0110
10_000_000
,0xFFFF_FFFF
,1.618_034
ARRAY[1,2,3]
ARRAY( SELECT ... )
INTERVAL '1 year 3 hours'
TIMESTAMP '2000-01-01T10:30:15'
,DATE '1999-07-20'
,TIME '13:30:00'
JSON '{"key": "value"}'
JSONB '{"key": "value"}'
ROW(1, 2.5, 'this is a test')
$foo
,$123
The text was updated successfully, but these errors were encountered: