-
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
SET TRANSACTION ... statement not supported #76
Comments
Sure, PRs are most welcome ! As a starting point, you can take a look to the A section in the contributing.md file of pg-mem repo (nb: implementing the parser part does not require implementing the statement in pg-mem, dont worry) The hard part is understanding Nearley, but it is not very hard. For some inspiration, you can have a look at #74 by @janpaepke which implements a simple statement (same level of complexity as SET TRANSACTION) If you have questions, feel free to ask ! I'll add this feature anyway when I have some time if you dont, but I cant say when :) |
Did someone say ne..ne..nearley? 🤪 What would you expect the resulting AST to look like? |
😄 My two cents: If implementing the whole documentation linked, there must be two statements. The export interface SetTransactionSnapshot extends PGNode {
type: 'set transaction snapshot';
snapshotId: string;
} As for the second one (which covers both export interface SetTransactionMode extends PGNode {
type: 'set transaction' | 'set session characteristics as transaction';
mode: TransactionMode[];
}
export type TransactionMode = TransactionModeIsolationLevel | TransactionModeAccess | TransactionModeDeferability;
export interface TransactionModeIsolationLevel extends PGNode {
type: 'isolation level';
level: 'serializable' | 'repeatable read' | 'read committed' | 'read uncommitted';
}
export interface TransactionModeAccess extends PGNode {
type: 'write mode';
readWrite: boolean;
}
export interface TransactionModeDeferability extends PGNode {
type: 'deferability';
deferable: boolean;
} nb: if you havent seen its usage elsewhere, to implement the |
begin; set transaction isolation level repeatable read, read only; commit;
fail to parse.With some pointers, I'd love to contribute a PR for this, if you're open to accepting it.
Docs:
https://www.postgresql.org/docs/current/sql-set-transaction.html
The text was updated successfully, but these errors were encountered: