Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/surrealdb/surrealdb.wasm
SurrealDB driver for WebAssembly
https://github.com/surrealdb/surrealdb.wasm
database database-connector iot-database javascript-library javascript-module realtime-database surreal surrealdb webassembly
Last synced: 3 months ago
JSON representation
SurrealDB driver for WebAssembly
- Host: GitHub
- URL: https://github.com/surrealdb/surrealdb.wasm
- Owner: surrealdb
- License: apache-2.0
- Created: 2022-04-07T16:16:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T09:35:27.000Z (7 months ago)
- Last Synced: 2024-04-22T02:13:02.063Z (7 months ago)
- Topics: database, database-connector, iot-database, javascript-library, javascript-module, realtime-database, surreal, surrealdb, webassembly
- Language: Rust
- Homepage: https://surrealdb.com
- Size: 247 KB
- Stars: 92
- Watchers: 20
- Forks: 13
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-surreal - surrealdb.wasm - <a href="https://surrealdb.com#gh-dark-mode-only" target="_blank"><img src="/img/white/text.svg" height="12" alt="SurrealDB"></a> <a href="https://surrealdb.com#gh-light-mode-only" target="_blank"><img src="/img/black/text.svg" height="12" alt="SurrealDB"></a> official driver for WebAssembly. (Client libraries)
README
A WebAssembly engine for the SurrealDB JavaScript SDK.
# surrealdb.wasm
A WebAssembly engine for the SurrealDB [JavaScript SDK](https://github.com/surrealdb/surrealdb.js).
This library is a plugin for the SurrealDB JavaScript SDK, which can be used to run SurrealDB as an embedded database within a browser environment, not server side environments.
It enables SurrealDB to be run in-memory, or to persist data by running on top of IndexedDB. It allows for a consistent JavaScript and TypeScript API when using the `surrealdb.js` library by adding support for embedded storage engines (`memory`, `indxdb`) alongside the remote connection protocols (`http`, `https`, `ws`, `wss`).
This library works with ES modules (`import`), not CommonJS (`require`).
## Example usage
```js
import { Surreal } from 'surrealdb.js';
import { surrealdbWasmEngines } from 'surrealdb.wasm';// Enable the WebAssembly engines
const db = new Surreal({
engines: surrealdbWasmEngines(),
});// Now we can start SurrealDB as an in-memory database
await db.connect("mem://");
// Or we can start a persisted IndexedDB database
await db.connect("indxdb://demo");// Now use the JavaScript SDK as normal.
```