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: docs/adr/0001-sqlite-wasm-selection.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ Accepted
13
13
GexVisor needs client-side database capabilities to query bundled GEX research data in the browser. The application is built with Blazor WebAssembly, which runs entirely in the browser without server-side processing.
14
14
15
15
**Requirements:**
16
+
16
17
- Query pre-built SQLite database files bundled with the app
17
18
- Read-only access (no write operations needed)
18
19
- Fast build times (avoid native WASM compilation)
@@ -27,7 +28,7 @@ Use **sql.js** with JavaScript interop for client-side SQLite queries.
27
28
28
29
**Architecture:**
29
30
30
-
```
31
+
```bash
31
32
Blazor Component
32
33
│
33
34
▼
@@ -43,18 +44,21 @@ sql.js (SQLite compiled to WASM)
43
44
## Consequences
44
45
45
46
**Benefits:**
47
+
46
48
- Most mature and battle-tested browser SQLite solution
47
49
- No native WASM compilation needed (faster builds, smaller bundles)
48
50
- Well-documented with active community
49
51
- Simple integration via JS interop
50
52
- Works reliably for read-only and in-memory databases
51
53
52
54
**Drawbacks:**
55
+
53
56
- Requires JavaScript interop layer (not pure .NET)
54
57
- No direct Entity Framework Core support
55
58
- Database is in-memory by default (requires IndexedDB for persistence if needed later)
56
59
57
60
**Implementation notes:**
61
+
58
62
- Database files bundled in `wwwroot/data/`
59
63
- SqliteService handles initialization and query execution
60
64
- Results returned as JSON arrays for Blazor consumption
@@ -72,6 +76,7 @@ NuGet package wrapping SQLite with EF Core support.
72
76
Newer approach using sqlite-wasm in a Web Worker with OPFS persistence.
73
77
74
78
**Rejected because:**
79
+
75
80
- More complex architecture than needed
76
81
- OPFS browser support varies
77
82
- Overkill for read-only use case
@@ -81,6 +86,7 @@ Newer approach using sqlite-wasm in a Web Worker with OPFS persistence.
81
86
Official Microsoft library compiled to WASM using native AOT.
0 commit comments