#quick.db other files

11 messages · Page 1 of 1 (latest)

copper robin
tulip spoke
copper robin
# tulip spoke sorry db is sqlite not json i want every db in other sqlite

It is essentially the same thing. The only difference is the property name and where you pass it.

Since quick.db uses the sqlite driver by default. You can just pass the filePath object property in the constructor to change where it will save the sqlite file

https://docs.plexidev.org/classes/QuickDB.html#constructor

Here you can see that the constructor takes a IQuickDBOptions which takes a filePath

https://docs.plexidev.org/interfaces/IQuickDBOptions.html#filePath

This will change where quick.db saves the sqlite file allowing you to change where it's located or create multiple if needed

tulip spoke
# copper robin https://plexidev.gitbook.io/quickdb/overview/changelog#sqlite This shows an exa...
Code :
import { QuickDB } from 'quick.db';

const db = new QuickDB({ filePath: 'db/test.sqlite' });

Error :
import { QuickDB } from 'quick.db';
         ^^^^^^^
SyntaxError: Named export 'QuickDB' not found. The requested module 'quick.db' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'quick.db';
const { QuickDB } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:179:5)
    at async Loader.import (node:internal/modules/esm/loader:178:24)
    at async Object.loadESM (node:internal/process/esm_loader:68:5)
    at async handleMainPromise (node:internal/modules/run_main:63:12)
copper robin
tulip spoke
copper robin
tulip spoke
copper robin
tulip spoke
#

thank you