Search code examples
javascriptnode.jsdatabaseelectrondisk

client side portable database, what to use?


I'm making a handover document database that must be offline and portable, easy to move from one pc to another.

I already tried sql.js but if I want to load db from file it should be with XHR, what exclude running it without http server.

How to solve the database issue(what to use), because it will be executed without any servers running and DB need to be in file?

//update

I'll have to put data <input type="text" name="username" value="">https://jsfiddle.net/wj5xb7bh/ from this form to db and also send them properly formated to printer. I will need to have possibility to search within DB to find who have what and what belongs to certain person, also i should be able to delete records and print from them, it should be able to contain more than 2k records.


Solution

  • Usually SQLite is used for things like that. See:

    Sql.js is basically SQLite compiled with Emscripten but in Node or Electron apps you can easily use real SQLite.

    SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private. SQLite is the most widely deployed database in the world with more applications than we can count, including several high-profile projects.