Commit Graph

188 Commits

Author SHA1 Message Date
Pekka Enberg
0abb917604 Limbo 0.0.13 2025-01-19 13:30:56 +02:00
Pekka Enberg
466bc8be0c Merge 'npm packaging for node and web' from Elijah Morgan
Add web support to npm package.
**Still a WIP need to do some cleanup still**
I assumed it is better to keep the server code and web code together in
the same package (bigger download number). It took quite a bit of
experimentation but the ultimate experience is
node - commonjs
```js
const { Database } = require("limbo-wasm/node");
```
web - module
```js
const worker = new Worker(new URL('limbo-wasm/web/limbo-worker.js', import.meta.url), { type: 'module' });
```
Like I said this took a lot of experimentation on my part as this is my
first time trying to create an npm package let alone that mixes commonjs
and modules.
The structure is an npm workspace with two sub packages (web and node).
```
node
├── dist
│   ├── README.md
│   ├── index.d.ts
│   ├── index.js
│   ├── index_bg.wasm
│   ├── index_bg.wasm.d.ts
│   └── snippets
│       └── limbo-wasm-d1562e55b90f5289
│           └── node
│               └── src
│                   └── vfs.js
├── package.json
└── src
    └── vfs.js
web
├── dist
│   ├── README.md
│   ├── index.d.ts
│   ├── index.js
│   ├── index_bg.wasm
│   ├── index_bg.wasm.d.ts
│   └── snippets
│       └── limbo-wasm-d1562e55b90f5289
│           └── web
│               └── src
│                   └── web-vfs.js
├── html
│   ├── index.html
│   ├── limbo-opfs-test.html
│   └── limbo-test.html
├── node_modules
├── package.json
├── playwright.config.js
├── src
│   ├── limbo-worker.js
│   ├── opfs-interface.js
│   ├── opfs-sync-proxy.js
│   ├── opfs-worker.js
│   ├── opfs.js
│   └── web-vfs.js
├── test
│   ├── helpers.js
│   ├── limbo.test.js
│   ├── opfs.test.js
│   └── setup.js
└── vite.config.js
```
The output of wasm-pack gets put in <web/node>dist
JS code moves into <web/node>src/
Tests move under web/test
The npm package looks like (you can see I need to cleanup some of the
stuff that gets included).
```
-rw-r--r--  0 0      0         195 Oct 26  1985 package/web/html/index.html
-rw-r--r--  0 0      0        2733 Oct 26  1985 package/web/html/limbo-opfs-test.html
-rw-r--r--  0 0      0         162 Oct 26  1985 package/web/html/limbo-test.html
-rw-r--r--  0 0      0         632 Oct 26  1985 package/web/test/helpers.js
-rw-r--r--  0 0      0       18128 Oct 26  1985 package/node/dist/index.js
-rw-r--r--  0 0      0       21732 Oct 26  1985 package/web/dist/index.js
-rw-r--r--  0 0      0        1836 Oct 26  1985 package/web/src/limbo-worker.js
-rw-r--r--  0 0      0        2108 Oct 26  1985 package/web/test/limbo.test.js
-rw-r--r--  0 0      0        1764 Oct 26  1985 package/web/src/opfs-interface.js
-rw-r--r--  0 0      0        3409 Oct 26  1985 package/web/src/opfs-sync-proxy.js
-rw-r--r--  0 0      0        1430 Oct 26  1985 package/web/src/opfs-worker.js
-rw-r--r--  0 0      0        3976 Oct 26  1985 package/web/src/opfs.js
-rw-r--r--  0 0      0        4502 Oct 26  1985 package/web/test/opfs.test.js
-rw-r--r--  0 0      0         269 Oct 26  1985 package/web/playwright.config.js
-rw-r--r--  0 0      0           0 Oct 26  1985 package/web/test/setup.js
-rw-r--r--  0 0      0         519 Oct 26  1985 package/node/dist/snippets/limbo-wasm-d1562e55b90f5289/node/src/vfs.js
-rw-r--r--  0 0      0         519 Oct 26  1985 package/node/src/vfs.js
-rw-r--r--  0 0      0         608 Oct 26  1985 package/web/vite.config.js
-rw-r--r--  0 0      0         435 Oct 26  1985 package/web/dist/snippets/limbo-wasm-d1562e55b90f5289/web/src/web-vfs.js
-rw-r--r--  0 0      0         435 Oct 26  1985 package/web/src/web-vfs.js
-rw-r--r--  0 0      0         146 Oct 26  1985 package/web/node_modules/.vite/deps/_metadata.json
-rw-r--r--  0 0      0         309 Oct 26  1985 package/node/package.json
-rw-r--r--  0 0      0         671 Oct 26  1985 package/package.json
-rw-r--r--  0 0      0          23 Oct 26  1985 package/web/node_modules/.vite/deps/package.json
-rw-r--r--  0 0      0         602 Oct 26  1985 package/web/package.json
-rw-r--r--  0 0      0         153 Oct 26  1985 package/web/node_modules/.vite/vitest/results.json
-rw-r--r--  0 0      0        1296 Oct 26  1985 package/node/dist/README.md
-rw-r--r--  0 0      0        1296 Oct 26  1985 package/README.md
-rw-r--r--  0 0      0        1296 Oct 26  1985 package/web/dist/README.md
-rw-r--r--  0 0      0        1217 Oct 26  1985 package/node/dist/index_bg.wasm.d.ts
-rw-r--r--  0 0      0        1217 Oct 26  1985 package/web/dist/index_bg.wasm.d.ts
-rw-r--r--  0 0      0         449 Oct 26  1985 package/node/dist/index.d.ts
-rw-r--r--  0 0      0        2554 Oct 26  1985 package/web/dist/index.d.ts
-rw-r--r--  0 0      0     2215065 Oct 26  1985 package/node/dist/index_bg.wasm
-rw-r--r--  0 0      0     2213889 Oct 26  1985 package/web/dist/index_bg.wasm
```
resolves #624

Closes #657
2025-01-19 12:53:21 +02:00
Elijah Morgan
74ddc42df0 Add back integration tests
Fix package.json for better imports vs web/nodejs
Fix examples and integration tests
2025-01-18 15:01:16 -05:00
Jorge López
683125fefb syntactic changes: factor duplicated code into helper function that can be reused 2025-01-18 19:20:11 +01:00
Jorge López
e4ab2fb273 syntactic changes: rewrite loop with while 2025-01-18 19:19:49 +01:00
Jorge López
86a4714711 syntactic changes: remove unneeded paths when the type is already imported 2025-01-18 18:29:12 +01:00
김선우
ab23e20732 Revert java image. Disable some failing test for now. 2025-01-18 09:52:42 +09:00
김선우
aa88dd5d1a Print out yest results while build 2025-01-18 09:42:48 +09:00
김선우
eaa8743c36 Nit 2025-01-18 09:16:09 +09:00
김선우
39245f35cc Add TODOs 2025-01-18 09:09:36 +09:00
김선우
5b9a158db1 Remove unused methods 2025-01-18 09:09:36 +09:00
김선우
a3a31e787c Initial pass on step function 2025-01-18 09:09:36 +09:00
김선우
5fc5f650cd Extract set_err_msg_and_throw_exception to utils.rs 2025-01-18 09:09:36 +09:00
김선우
7028d963ba Remove unused methods for now 2025-01-18 09:09:36 +09:00
김선우
f6ec2252cf Group "pointer to struct" and "struct to pointer" functions 2025-01-18 09:09:36 +09:00
김선우
9765eaba52 Implement prepare 2025-01-18 09:09:36 +09:00
김선우
b77bf879f7 Implement prepare on java side 2025-01-18 09:09:36 +09:00
김선우
3e2e998060 Rename fileName to filePath for clarity 2025-01-18 09:09:36 +09:00
김선우
0819963b2f Implement rust side connect and prepare function 2025-01-18 09:09:36 +09:00
김선우
7e78ec448b Clean up error code related classes 2025-01-18 09:09:36 +09:00
김선우
fcadc2f825 Add connect function for creating connections from limbo db 2025-01-18 09:09:36 +09:00
김선우
3409a82513 Add LimboDBFactory to support multiple LimboDB in single process 2025-01-18 09:09:36 +09:00
김선우
0a071d26f7 Add logback dependency for logging 2025-01-18 09:09:36 +09:00
김선우
a6f389125c Implement minimal JDBC4Statement#exec(String sql) 2025-01-18 09:09:36 +09:00
김선우
8a1ffbbb65 Add JDBC4ResultSet 2025-01-18 09:09:36 +09:00
Elijah Morgan
6a7b269aa7 fixup dropped meta data 2025-01-16 21:30:36 -05:00
Elijah Morgan
c6d4484e63 bump versions 2025-01-16 21:29:19 -05:00
Elijah Morgan
f20a2d1334 Reorg to single package
Handle commonjs and esm module entry points

tests works
2025-01-16 21:29:19 -05:00
Elijah Morgan
f7be8b834b got vitest working
run via npm run test -w web
2025-01-16 21:29:19 -05:00
Elijah Morgan
02e4104932 reorg package structure
src moved under web/ to make it cleaner
build does less moving of files, mostly just moves the wasm-pack
into dist for node and web
2025-01-16 21:29:19 -05:00
Elijah Morgan
f75a1f89c4 WIP restructure
going to try out something different
2025-01-16 21:29:19 -05:00
Elijah Morgan
f81dfed922 Node and Web basic npm package test work 2025-01-16 21:29:16 -05:00
Elijah Morgan
8fa3a760c7 Web test of npm package works
Node one broke
2025-01-16 21:28:33 -05:00
Elijah Morgan
6bd40430bf Begin adding nodejs/web to a single npm package
Update build script to build both
Update package.json

Add basic test of node variant of npm package.
2025-01-16 21:28:29 -05:00
김선우
d151824f66 Update JDBC4Statement to include resultSetType, resultSetConcurrency, resultSetHoldability 2025-01-15 09:46:42 +09:00
김선우
7104a290e4 Basic support for close method 2025-01-15 09:20:44 +09:00
김선우
e5bf3c2644 Add Codes.java 2025-01-15 09:11:51 +09:00
김선우
eed610d457 Add JDBC4Statement.java 2025-01-15 09:08:45 +09:00
Pekka Enberg
bfbaa80bdc Merge 'Change bindings/java to support java 8' from Kim Seon Woo
## Purpose of this PR
Change java bindings support from jdk version 17 to 8.
## Changes
- Mostly related to dependency version updates
- Replace java 8 non supported methods
## Reference
https://github.com/tursodatabase/limbo/issues/615

Closes #678
2025-01-14 14:17:39 +02:00
김선우
b3883d03d6 Apply necessary changes for java 8 2025-01-14 20:14:32 +09:00
김선우
eacd7b7945 Change bindings/java to support java 8 2025-01-14 20:08:13 +09:00
김선우
66c9832bec Create top level licenses directory 2025-01-14 19:33:29 +09:00
Pekka Enberg
b6ae8990e3 Limbo 0.0.12 2025-01-14 11:39:17 +02:00
김선우
a48cb8bbfc Merge branch 'main' into java-nullability 2025-01-14 17:49:36 +09:00
김선우
04cd655574 Change VALID_URL_PREFIX to use sqlite instead 2025-01-14 17:19:33 +09:00
김선우
f03b6bffde Update license path 2025-01-14 17:12:03 +09:00
김선우
5c9990f41a Merge branch 'main' into java-nullability 2025-01-14 17:09:45 +09:00
Pekka Enberg
af020c27d6 Initial take on Rust bindings
This implements libSQL compatible Rust API on top of Limbo's core. The
purpose of this is to allow libraries and apps that build on libSQL to
use Limbo.
2025-01-14 09:16:46 +02:00
김선우
23d17dba25 Merge branch 'main' into java-limbo-connection 2025-01-14 07:35:09 +09:00
Pekka Enberg
fa6a9ed214 Merge 'bindings/java: Fix naming rules' from Kim Seon Woo
## Purpose of this PR
- Set rules for java naming, maybe we can add tests to  automatically
test rules in the future
- For java methods, don't use underbar(IMO using camelcase for java
methods seems to be the common convention)
- If method names collide, append 0 at the back
## Reference
https://github.com/tursodatabase/limbo/issues/615

Closes #645
2025-01-13 18:39:24 +02:00