-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: add support to restart identity on truncate #42
feat: add support to restart identity on truncate #42
Conversation
Actually, It translates |
type: 'truncate table', | ||
tables: x[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.
Technically, that parses, but the fact that restart identity
is present should influence the generated AST.
In another hand, when it is NOT present, the generated AST should be the same as previously.
Moreover, if you implement restart identity
, you should also implement continue identity
... see the spec.
Meaning something like:
delete_truncate -> (kw_truncate %kw_table:?) array_of[table_ref] ((kw_restart | kw_continue) kw_identity):? {% x => track(x, {
type: 'truncate table',
tables: x[1],
...x[2] && { identity: toStr(x[2][0]) },
})
and modify the corresponding AST typing definition:
export interface TruncateStatement {
type: 'truncate table',
// [.....]
identity?: 'restart' | 'continue';
}
Thanks :) |
Released as |
see here |
@oguimbal any plans to use it in pg-mem? |
ref #41
Not sure about the implementation itself, I never played with Nearley before.