In this section, you will learn how to interact with SQLite databases from a Node.js application using the
sqlite3 module. After the tutorial, you will know how to open a database connection and perform common database operations such as select, insert, update, and delete. In addition, you will learn how to execute SQL statements in serialized mode or in parallel mode.
sqlite3 module is actively maintained and provides a rich set of features:
- Simple API for query execution
- Parameters binding support
- Control the query execution flow, supporting both serialized and parallel modes.
- Comprehensive debugging support
- Full caching / Blob support
- SQLite extension support
- Bundles SQLite as a fallback
To understand how the
sqlite3 module works, you can use the following tutorials in sequence:
- Connecting to an SQLite3 database – shows you how to connect to an in-memory database or a file-based database.
- Querying data from tables – introduces you various methods for querying data from tables.
- Controlling the execution flow of statements – explains the steps of executing multiple SQL statements in serialized mode or in parallel mode.
- Inserting data into a table – shows you how to insert one or more rows into a table.
- Updating data – covers the steps of updating data in a table.
- Deleting data from a table – show you how to delete data from a table.