Title

SQLite in Node.js From Inside Out

Short Summary

SQLite is having its Renaissance. It’s being used in many projects and companies. Bun runtime has its implementation of SQLite, Turso is a product on top of SQLite, and the Ruby on Rails framework dropped all its dependency on Redis in favor of SQLite for things like Caching and Queues.

Node.js version 22.5.0 introduced the node:sqlite module. It’s an experimental module that allows you to use SQLite in a very Node.js way, without any external dependency.

In this talk, you will learn how to use SQLite in Node.js. We will explore the current node:sqlite features and how to use them. We will also explore the future of SQLite in Node.js.

Long Description

Since last year I’ve been contributing to NodeJS (https://github.com/nodejs/node/pulls q=is%3Apr+author%3Ageeksilva97+). In the past few months, I’ve been working on the node:sqlite where I could implement features like backup. I’m still focused on it, bringing new features and improvements.

That’s why I want to share with you what I’ve learned and what I’m working on. The state and the future of SQLite in Node.js.

This talk is for anyone interested in learning more about what’s new in Node.js and how to use SQLite in Node.js.

Outcomes

  • See good use cases for SQLite
  • Learn Node.js SQLite module and what it can do
  • Explore the future of SQLite in Node.js
  • Discover how you can help the SQLite development in Node.js

Outline

Intro

  • The SQLite Renaissance:

The node:sqlite module

  • The Basics: I explain and give examples of queries like SELECT, INSERT, UPDATE, DELETE through the node:sqlite module
  • Working with Sessions: I show how to use sessions with real-world examples
  • User defined functions: I discuss the whys and hows of user defined functions
  • Database backup: I show how to backup a database and monitor its progress

The future of SQLite in Node.js

  • Async API: there’s a proposal to add an async API to the node:sqlite module as well as a promise-based APIs in fs (https://github.com/nodejs/node/issues/54307). Here I discuss the benefits and what to expect from this async API.
  • Aggregates: I’ve been working on an implementation of aggregates for the node:sqlite module (https://github.com/nodejs/node/pull/56600). I show how it works and how you can use it. I also discuss the benefits of using aggregates in SQLite.

Short Bio

Since last year I’ve contributing to NodeJS (https://github.com/nodejs/node/pulls?q=is%3Apr+author%3Ageeksilva97+), and it has been an amazing experience! I fell in love with the community and, even more, with JavaScript.

I also like to write about tech and philosophy as well as recreating famous projects (e.g. JVM compiler) just to learn how things work under the hood.