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

Support for issuing prepared statements? #24

Closed
awinder opened this issue Dec 11, 2013 · 6 comments
Closed

Support for issuing prepared statements? #24

awinder opened this issue Dec 11, 2013 · 6 comments

Comments

@awinder
Copy link

awinder commented Dec 11, 2013

Vertica supports prepared statements as a means of optimizing queries and providing some convenience / security benefits as of the 6.x branch (https://my.vertica.com/docs/6.1.x/HTML/index.htm#11677.htm). Is this supported in node-vertica? I saw some use of the string "prepared_statement" in the FrontendMessage class, but I was having trouble groking how this would be used (or if it was even applicable).

@wvanbergen
Copy link
Owner

When I first implemented it, it was broken on the vertica server. It only supported prepared statements with 0 parameters. Becuase that's useless, and to protocol with prepared statements is a lot more complicated, I decided to remove the implementation completely.

Not sure what version I was developing against, either 5.1 or 6.0 at the time. Maybe it is supported now.

@awinder awinder closed this as completed Mar 10, 2014
@RickCSong
Copy link

@wvanbergen Attempted to implement prepared statements for Vertica 7.1 today. Appears to still be broken :( (i.e., only supports prepared statements with 0 parameters).

@wvanbergen
Copy link
Owner

Too bad :(

@amirtuval
Copy link

Hi Guys

I'm testing Vertica's performance, and I think having prepared statements - even without parameters - may improve performance for my use case.

Can you provide some pointers on how to implement prepared statements with the given protocol?

Thanks

@wvanbergen
Copy link
Owner

It should follow the PostgreSQL protocol: https://www.postgresql.org/docs/9.2/static/protocol-overview.html#PROTOCOL-QUERY-CONCEPTS

I managed to get it to work for 0 parameters, but when using parameters it would fail. I assume this has not changed.

@amirtuval
Copy link

I was able to get it to work - I investigated how the vertica jdbc driver does it.
Sent a pull request for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants