Comments (2)
You can use as many connections as you'd like, but you'll get the best performance by using 1 connection per process. For example, create the connection in a separate file and export it with module.exports = myDbConnection
. Any other file that needs to use the database can require()
that file and use the connection directly. That single connection can handle queries and inserts from thousands of clients.
from better-sqlite3.
Closing this. Feel free to comment if you have more questions.
from better-sqlite3.
Related Issues (20)
- Exposing file control operations
- Could not dynamically require "better_sqlite3.node" HOT 1
- Extensions share state HOT 1
- Failed to execute SQL with error: TypeError: The database connection is not open HOT 2
- Cannot read database in Tauri + Vue + Vite HOT 1
- possible strange issue with an ATTACHed database HOT 1
- The "IN (?)" statement with an array produces a "Too many parameter values" error
- [Bug]: Report dlopen error after codesign and notarize HOT 2
- Unable to use with electron HOT 21
- identifying a better-sqlite3 Database object HOT 3
- WAL mode - Random Transaction (Insert Many) do nothing... HOT 2
- SQliteError: near OR unrecognized token if columns starts with number HOT 3
- Modifying the database causes electron application to crash HOT 1
- db.prepare is not a function HOT 3
- Performance numbers might not be representitive or are outdated
- value.getTime is not a function HOT 1
- Allow easy way to get Sqlite3 version HOT 3
- better-sqlite3: Running install script, failed with nodejs 20 HOT 2
- prebuild ERR! build Error: Error from GitHub: Not Found HOT 1
- Supporting `generate_series` ? HOT 1
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 better-sqlite3.