-
Notifications
You must be signed in to change notification settings - Fork 843
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
sqlite: bulk insert / copyfrom equivalent #3305
Comments
That type of multiple inserts is supported by most engines, but, at the moment, not suported by sqlc which would by nice IMO. That being said, it isnt really a robust bulk instert like COPY on postgres or LOAD DATA and shouldn't use |
If you want to get really cute about it, you can already use
EDIT: Forgot the |
I too need this feature. |
Any update on this? |
@rishi-kulkarni OOC, does your example above work for you? I'm basically looking for any workaround to get a multi-value into SQLite, but when I plug that into sqlc, it doesn't seem to respect a parameter to -- name: JSONEachTest :execresult
INSERT INTO users(name, email) SELECT e.value ->> 'name', e.value ->> 'email' FROM json_each(?) e; const jSONEachTest = `-- name: JSONEachTest :execresult
INSERT INTO users(name, email) SELECT e.value ->> 'name', e.value ->> 'email' FROM json_each(?) e
`
func (q *Queries) JSONEachTest(ctx context.Context, db DBTX) (sql.Result, error) {
return db.ExecContext(ctx, jSONEachTest)
} (Note, no parameters extracted to |
What do you want to change?
SQLite 3.7.11 and above supports bulk inserts with the syntax:
How difficult would it be to support this in sqlc? Happy to contribute if that's what's required to make it happen!
What database engines need to be changed?
SQLite
What programming language backends need to be changed?
No response
The text was updated successfully, but these errors were encountered: