Comments (4)
Sounds good. This would be nice to add as createMany
, with a few considerations:
- Batching bulk inserts to configurable chunks (default = 100?)
- sqlite doesn't support
returning
oroutput
clauses. I worked around that in the design ofcreate
but I'm not sure that would translate tocreateMany
, so the return value would be the number of rows, a boolean, or nothing.
from trilogy.
- Batching bulk inserts to configurable chunks (default = 100?)
I think there are some limitations in sqlite bulk inserts, (eg: SQLITE ERROR, Toomany Variables) when you insert many rows at a time. Is there any basis for deciding the default chunk value to 100?
- sqlite doesn't support
returning
oroutput
clauses. I worked around that in the design ofcreate
but I'm not sure that would translate tocreateMany
.
yeah, but I don't think that is required in bulk inserts.
from trilogy.
Is there any basis for deciding the default chunk value to 100?
None at all :) Probably 500 or even 1,000 is doable, I just don't know what the typical limit is and will have to look into it.
yeah, but I don't think that is required in bulk inserts.
Agreed, I just wanted to point out the return value would be different between create
and createMany
, but that'll be documented anyway.
from trilogy.
I just tried with a table with 4 columns , and fails at chunk of 240 with this, await db.knex<UserDocType>("users").insert(userArry)
, function. (Error : SQLITE ERROR, Toomany Variables).
When the chunks are smaller the net time taken for the query is more when compared with larger chunks.. Is it possible optimize the chunks count dynamically ?
from trilogy.
Related Issues (20)
- Angular9 compilation error HOT 6
- 3.0.0 HOT 4
- potential security vulnerability in latest stable release 2.0.2 HOT 4
- Password Protect the SQLite database HOT 1
- Discussions are now open
- sqlite error: no such table: tablename_returning_temp HOT 7
- Issues creating and locating a database in a React application HOT 2
- Cannot find module 'sql.js/module' HOT 3
- timestamps don't create HOT 4
- Cannot update with timestamps set to true HOT 1
- Update dependencies and release new version HOT 2
- Preload memory database content
- Awesome Electron HOT 1
- Electron Vue Project - Error: Failed to compile HOT 1
- TypeError: SQL.Database is not a constructor HOT 7
- sqljs usage changes HOT 2
- Issue while using with angular 8 and electron HOT 2
- Can find accecpts Array? HOT 2
- Knex: run$ npm install sqlite3 --saveCannot find module HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trilogy.