Skip to content
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

T885 Add prepared statements support to sqlparser #303

Merged

Conversation

storojs72
Copy link
Contributor

  1. Add PREPARE stmt_name FROM preparable_stmt statment support;
  2. Add EXECUTE stmt_name [USING @var_name [, @var_name] ...] statement support;
  3. Add DEALLOCATE PREPARE stmt_name statement support.

sqlparser/ast.go Show resolved Hide resolved
sqlparser/ast.go Outdated Show resolved Hide resolved
sqlparser/sql.y Show resolved Hide resolved
sqlparser/sql.y Outdated Show resolved Hide resolved
sqlparser/sql.y Show resolved Hide resolved
testQueries := []string{
`prepare stmt1 from 'select 1'`,
`prepare stmt1 from @variable`,
`prepare stmt1 from E'pg_escape_string'`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should not support this type of literals

sqlparser/parse_test.go Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
tests/test.py Show resolved Hide resolved
@vixentael
Copy link
Collaborator

@Lagovas @storojs72 are there fixes to be made for this PR to be complete?

@storojs72
Copy link
Contributor Author

Yes, one more - to handle case of PREPARE fooplan (int, text, bool, numeric) AS INSERT INTO foo VALUES($1, $2, $3, $4);

@storojs72
Copy link
Contributor Author

@Lagovas look please this PR once more from the beginning

@storojs72 storojs72 merged commit 478efd3 into cossacklabs:master Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants