Skip to content

sql_insert output batching #2096

Answered by mihaitodor
antipopp asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @antipopp 👋

When flushing the batch, what's the generated query? Will it be n INSERT queries, or one single insert into table values query?

It will be the latter unless the driver supports transactions (only clickhouse and oracle for now). In the case of postgres, it should send a single INSERT query along with a list of rows of values, each row having the same length as the columns list in the config.

Here's a working demo:

> docker run --rm -it -e POSTGRES_USER=testuser -e POSTGRES_PASSWORD=testpass -e POSTGRES_DB=testdb -p 5432:5432 postgres
> pgcli postgres://testuser:testpass@localhost:5432/testdb
testuser@localhost:testdb> create table production(foo int, bar int);

Now create…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@antipopp
Comment options

Answer selected by antipopp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants