Fastify plugin that integrates SQLite3 databases via the sqlite3 package. Current version 1.1.0, compatible with Fastify v4. Supports both callback-based and promise-based APIs (via sqlite wrapper). Provides options for in-memory databases, file-based storage, verbose logging, and named decorators. A lightweight alternative to more feature-rich ORMs like TypeORM or Sequelize for SQLite.
npm install fastify-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows registering plugin with promise-based API and running a simple query.
Update to 1.1.0 and ensure sqlite package is installed if using promiseApi: true.
Always await app.ready() before accessing app.sqlite.
Use promiseApi: true if you need async/await support. Note: requires installing the 'sqlite' package as a peer dependency.
Upgrade Fastify to v4 if you are on v3 and want to use this plugin.
Run npm install sqlite or yarn add sqlite.
Ensure you await app.ready() before using app.sqlite.
Create the table before querying, or ensure you are using a persistent dbFile.
Import as import fastifySqlite from 'fastify-sqlite' and register it.