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

Multi-row statement parameters #14

Closed
rcallahan opened this issue Dec 3, 2014 · 3 comments
Closed

Multi-row statement parameters #14

rcallahan opened this issue Dec 3, 2014 · 3 comments

Comments

@rcallahan
Copy link

I'd like to be able to do bulk insertions and updates with queries like `INSERT INTO a VALUES (?)" where ? :: Mapping a, Mapping b => [(a,b)]

@nikita-volkov
Copy link
Owner

I'm not sure I understand what your actual request is here.

@rcallahan
Copy link
Author

I would like to be able to do a query such as INSERT INTO Table ( Column1, Column2 ) VALUES ( Value1, Value2 ), ( Value1, Value2 ). Is there currently a way to turn [(a,b...)] into a StatementArgument?

edit: After reading the libpq documentation, I see there's no way to do this in a way that fits the hasql's api. The only sensible way to do this is to create a string query containing all the values.

@nikita-volkov
Copy link
Owner

It's possible to do this. See this comment.

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

2 participants