Questions tagged [better-sqlite3]
Better-SQLite3 is a Node.js API for SQLite3, claiming ease-of-use, improved efficiency and faster processing.
better-sqlite3
118
questions
0
votes
0
answers
20
views
Module not found: Can't resolve 'fs' using better-sqlite3 in NextJs
I am trying to build a web3 project
I used wagmi to create a new project. This has nextjs included.
Now i wanted to use a database with my nextjs so i installed better-sqlite3
This is my code for the ...
0
votes
0
answers
13
views
Can I use Sqlite json functions like 'json_extract' with better-sqlite3?
Is it possible to use Sqlite json functions like 'json_extract' with better-sqlite3 ? If possible how can I do this ? Thanks in advance.
0
votes
1
answer
14
views
backend dependency within Svelte component library gets imported on SvelteKit (Vite/Rollup) build
I created a Svelte component library which uses better-sqlite3 for some backend methods.
When building an app which uses this custom library, better-sqlite3 gets imported and bundled, causing issues ...
0
votes
1
answer
58
views
SQL sort for name with favorites on top
I have a list with sort filters. Based on the parameter, I want it to show the favorites with that parameter on top while keeping them sorted by name (if on the same value):
Example 1: Order from A-Z
...
0
votes
0
answers
103
views
How do I depend on prebuilt Node.js binaries of better-sqlite3, instead of building them myself?
I have an old TypeScript/Node.js component which uses better-sqlite3 version 7.6.1 with the help of PNPM.
I want to lift the Node version (and other dependencies too).
When I build my component, it ...
0
votes
1
answer
301
views
Dockerfile for sqlite3 solving the error with better-sqlite3
in my project I need a Dockerfile for sqlite3 because I am using microservices with Kubernetes and Docker and on Windows and MacOS it gave me the same error when installing.
the project uses nodejs ...
0
votes
0
answers
51
views
Jest: mocking a method from a better-sqlite3 using Typescript
I'm trying to test a function that is calling a resolved method from better-sqlite3 but it always tells me it's trying to read undefined.
These are my files.
./src/db.ts
import Database from "...
0
votes
0
answers
695
views
Performing Drizzle ORM migration in vitest results in permission errors
In a test i'm using Drizzle ORM to do migrations in vitest beforeAll, but it doesn't work like when I run a script from
"db:migrate": "tsx db/migrate.ts", //runs with no issues
...
0
votes
0
answers
79
views
Random SQLite slow queries during read (SELECT with join from FTS5 table) maybe due to caching issues
We are having some inconsistent behaviour with slow reads which I think come due to caching misses.
I am giving some background to the server setup:
AWS EC2 instance with 4GB of RAM, so Ubuntu OS. ...
0
votes
0
answers
53
views
how do i interact with my sqllite db from my react electron app, if i cant import files outside src
I am trying to save user details on my db when the user login is successful in my react electron app,
what is the best and safest way to do this, because when I try to import DB into my actions file I ...
0
votes
1
answer
414
views
better-sqlite3 TypeError: o.default is not a constructor
I am creating a vscode extension in typescript, webpack and better-sqlite3. I try to create a database in the C:\Users\userName\AppData\Roaming\Code\User\globalStorage\ folder.
But i get the error:
...
0
votes
0
answers
36
views
Using better-sqlite3 how would you run EXPLAIN QUERY PLAN (programatically)
Should be a simple answer,
How can I execute an EXPLAIN QUERY PLAN in JS using better-sqlite3.
I've tried:
db.prepare('EXPLAIN QUERY PLAN select * from users').all();
db.pragma('EXPLAIN QUERY PLAN ...
4
votes
1
answer
717
views
Password Protect a "better-sqlite3" DB file
I have an electron-angular-node project which has few tables. I am using :
electron version: 13.1.7
Angular CLI: 12.0.2
Node: 16.17.0
Package Manager: npm 9.2.0
OS version: Windows 10
better-sqlite3: ...
1
vote
1
answer
393
views
How to deserialize SQlite to TS class?
Using Sqlite3 from Electron's main package, I am able to create tables, insert rows, and read those rows. How do I instantiate rows read into defined classes?
Example:
export const GetAllObjs = (): ...
0
votes
0
answers
55
views
Having multiple SQLite databases to Reduce Concurrency
I was wondering if it's good practice to have multiple Sqlite databases? My thinking is that I would keep all my relational data in one database and have non-relational data (data that are stored in ...