You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ sql.js is a light wrapper around SQLite compiled with EMScripten for use in the
6
6
7
7
This repo is a fork of and wrapper around sql.js to provide a read-only HTTP-Range-request based virtual file system for SQLite. It allows hosting an SQLite database on a static file hoster and querying that database from the browser without fully downloading it.
8
8
9
-
The virtual file system is an emscripten filesystem with some "smart" logic to accelerate fetching with virtual read heads that speed up when sequential data is fetched. It could also be useful to other application, the code is in [lazyFile.ts](./src/lazyFile.ts).
9
+
The virtual file system is an emscripten filesystem with some "smart" logic to accelerate fetching with virtual read heads that speed up when sequential data is fetched. It could also be useful to other applications, the code is in [lazyFile.ts](./src/lazyFile.ts). It might also be useful to implement this lazy fetching as an [SQLite VFS](https://www.sqlite.org/vfs.html) since then SQLite could be compiled with e.g. WASI SDK without relying on all the emscripten OS emulation.
10
10
11
-
Note that this only works well if your database and indices is structured well.
11
+
Note that this whole thing only works well if your database and indexes are structured well.
12
12
13
-
It also provides a proof-of-concept level implementation of a DOM virtual table that allows interacting (read/write) with the browser DOM directly from within SQLite queries.
13
+
sql.js-httpvfs also provides a proof-of-concept level implementation of a DOM virtual table that allows interacting (read/write) with the browser DOM directly from within SQLite queries.
const result =awaitworker.db.exec(`select * from table where id = ?`, [123]);
72
72
73
+
73
74
```
74
75
75
76
## Is this production ready?
@@ -84,4 +85,4 @@ This project is inspired by:
84
85
*https://phiresky.github.io/tv-show-ratings/ a project of mine that fetches the backing data from a WebTorrent (and afterwards seeds it). Not SQLite though, just a torrent with a set of hashed file chunks containing protobufs.
85
86
*https://phiresky.github.io/youtube-sponsorship-stats/?uploader=Adam+Ragusea what I originally built sql.js-httpvfs for
86
87
87
-
The original code of lazyFile is based on the emscripten createLazyFile function, though not much of that code is remaining.
88
+
The original code of lazyFile is based on the emscripten createLazyFile function, though not much of that code is remaining.
0 commit comments