
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
fastify-sqlite
Advanced tools
Fastify plugin to connect to a SQLite3 database.
Under the hood, this plugin uses sqlite3
.
npm install fastify-sqlite
Plugin version | Fastify version |
---|---|
^1.0.0 | ^4.0.0 |
const fastifySqlite = require('fastify-sqlite')
async function main () {
const app = fastify()
app.register(fastifySqlite, {
dbFile: 'foo.db'
})
await app.ready()
app.sqlite.all('SELECT * FROM myTable', (err, rows) => {
// do something
})
}
main()
Checkout the sqlite3 documentation to see all the available methods.
Note that Promise APIs are not supported by the sqlite3
module by default.
By using the promiseApi
option, the sqlite
wrapper will be used
to enhance the Database instance. It has many convenient utilities such as migration
support.
You can pass the following options to the plugin:
await app.register(require('fastify-sqlite'), {
promiseApi: true, // the DB instance supports the Promise API. Default false
name: 'mydb', // optional decorator name. Default null
verbose: true, // log sqlite3 queries as trace. Default false
dbFile: ':memory:', // select the database file. Default ':memory:'
mode: fastifySqlite.sqlite3.OPEN_READONLY
// how to connecto to the DB, Default: OPEN_READWRITE | OPEN_CREATE | OPEN_FULLMUTEX
})
// usage WITH name option
await app.sqlite.myDb.all('SELECT * FROM myTable')
Copyright Manuel Spigolon, Licensed under MIT.
FAQs
Fastify plugin to connect to a SQLite database
The npm package fastify-sqlite receives a total of 92 weekly downloads. As such, fastify-sqlite popularity was classified as not popular.
We found that fastify-sqlite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.