sequelize-browser


A build of sequelize that runs in a web browser.

Here, it runs on a SQLite in-memory database through sql.js web-browser-compatible interface.

How to use

First, sequelize-browser and its dependencies should be included on a web page:

<script src="https://unpkg.com/sequelize-browser@6.x/sequelize.script.js"></script>
<script src="https://unpkg.com/sql.js-as-sqlite3@0.2.x/bundle/sql.js-as-sqlite3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.11.0/sql-wasm.min.js"></script>
<script>
  // In order to run, `sql.js` requires downloading `*.wasm` modules in real time.
  // The "base URL" for those `*.wasm` modules to be downloaded from is configured via a global `SQL_JS_WASM_FILE_BASE_URL` variable.
  // The "base URL" must end with a trailing slash ("/").
  // Both the included `sql-wasm.min.js` script and the `*.wasm` modules should be located at the same "base URL".
  SQL_JS_WASM_FILE_BASE_URL = 'https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.11.0/'
</script>

After that, just start writing sequelize code (the code below is editable):