I somehow managed to patch absurd-sql, Sequelize, and sql.js together, and now there's a fully functional Sequelize ORM on an editable SQLite that liv

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-09-28 22:30:05

I somehow managed to patch absurd-sql, Sequelize, and sql.js together, and now there's a fully functional Sequelize ORM on an editable SQLite that lives inside a filesystem built on IndexedDB. Yeah, it's as crazy as it sounds.

I spent the past week reading and patching each of these separately, then together, to make them work on an editable SQLite database in a browser using IndexedDB. Never thought it was possible!

Once it's running, you can use Sequelize ORM just like you would in any Node.js project, but it works inside the browser. All the SQL transactions are backed by IndexedDB.

The magic happens when these libraries are patched together. Sequelize communicates with the SQLite database (via sql.js), and absurd-sql ensures that the database can be persisted and queried through IndexedDB.

Leave a Comment