-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix: support create type
#118
Conversation
} | ||
|
||
#[test] | ||
fn test_create_composite_type() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: create type as
constitute a composite type
@cvng thanks! yes, there are some that do not work yet. I have already created an issue to investigate. if you like, please go ahead and check them. |
SyntaxToken::Required(SyntaxKind::TypeP), | ||
SyntaxToken::Required(SyntaxKind::Ident), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,6 +1,6 @@ | |||
CREATE TYPE type1; | |||
CREATE TYPE type1 AS (attr1 int4, attr2 bool); | |||
CREATE TYPE type1 AS (attr1 int4 COLLATE collation1, attr2 bool); | |||
/* TODO: CREATE TYPE type1 AS (attr1 int4 COLLATE collation1, attr2 bool); */ SELECT 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't get COLLATE
to work here, I have tried CollateClause
ColumnDef
CompositeTypeStmt
with no luck
it is obfuscated in the macro stack but we have a hint that it panics in codegen::get_location_internal
, | ||
errors: [], | ||
stmts: [], | ||
stmts: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
awesome! |
What kind of change does this PR introduce?
add support for object type in
DefineStmt
What is the current behavior?
--
What is the new behavior?
--
Additional context
while working on this, I realized there is a few statements that have an AST mismatch from
pg_query
:https://github.com/search?q=repo%3Asupabase%2Fpostgres_lsp+%22stmts%3A+%5B%5D%2C%22&type=code
with either: no AST (sometimes expected) or AST with wrong nodes (eg. for
create procedure
)@psteinroe lmk if i should try to investigate these ones next