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

What is the best method that "bulk insert" and "where in" ? #312

Closed
dyoshikawa opened this issue May 10, 2020 · 2 comments
Closed

What is the best method that "bulk insert" and "where in" ? #312

dyoshikawa opened this issue May 10, 2020 · 2 comments

Comments

@dyoshikawa
Copy link
Contributor

dyoshikawa commented May 10, 2020

I want to bulk insert with sqlx.

-- bulk insert example
INSERT INTO people(name)
VALUES('foo'), ('bar'), ('baz')

I also want to "where in" with this.

-- where in example
SELECT * FROM people WHERE name IN ('foo', 'bar', 'baz')

I wrote the code and created the repository:
https://github.com/dyoshikawa/sqlx-bulk-insert-and-where-in-query-example/blob/fcc50716f4ed8d48924de996863aa6916f89af8d/src/main.rs#L19-L59

Do you have the idea better than this?
Thanks for reading.

@pythoneer
Copy link

related/duplicate issue?
#294
#291

@dyoshikawa
Copy link
Contributor Author

Yes, thanks.
This issue was closed.

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