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

Bulk inserts #43

benoist opened this Issue Mar 2, 2017 · 1 comment


None yet
2 participants
Copy link

benoist commented Mar 2, 2017


To be able to do really fast imports it's better to create a bulk insert query. Currently I'm creating a string with StringBuilder and escape the values before adding it to the query string, however this leads to memory bloat as the query string can easily be over 1MB.

Perhaps it would be nice to support a feature like:

db.insert("table_name", {"column_1", "column_2"}) do |statement|
  1000.times do
    statement.push("value", 1)

This comment has been minimized.

Copy link

hinrik commented Nov 13, 2017

I needed this functionality in a project of mine and came up with this:

Is this something that could get included in crystal-db?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment