absurd-sql
absurd-sql copied to clipboard
TypeScript support
@quolpr You mentioned that you were interested in helping migrate to TypeScript. Are you still interested in that? I'm familiar with it, but not as familiar with setting it up on a new project.
@jlongster yep, I can do that. But I am not sure about the deadlines, cause right now I am pretty busy
No rush! You know me, other things in life are more important :)
I can help a lot with migrating the actual code. I don't know a ton about what's needed in all the tooling to get TS running though.
@quolpr Are you working on that? I can do it.
@steida I am waiting for when https://github.com/jlongster/absurd-sql/pull/36 PR will be merged, then I will open another PR where I will be working on typescript support.
I would be happy to any help 🙂
@steida @quolpr ... I have working examples of SQL.js working in a web worker but not having good luck bootstrapping absurd-sql even with blatant use of any
. Does any one have example of this working in typescript at any level? Specifically getting CompileError: WebAssembly.instantiate(): BufferSource argument is empty
@delaneyj I got this error when sql-wasm.wasm
failed to load (404)
The initSqlJs
has a locateFile
callback to tell where the wasm file should be loaded from. So with vite
I used:
let SQL = await initSqlJs({
locateFile: (file: string) => {
const result = `/node_modules/@jlongster/sql.js/dist/${file}`;
return result;
},
});
For vite it's better to do:
import absurdSqlWasmUrl from "@jlongster/sql.js/dist/sql-wasm.wasm?url";
let SQL = await initSqlJs({
locateFile: () => absurdSqlWasmUrl,
});
For CRA:
import sqlWasmUrl from "@trong-orm/sql.js/dist/sql-wasm.wasm";
let SQL = await initSqlJs({
locateFile: () => sqlWasmUrl
});
Some more info could be found here: https://trong-orm.netlify.app/backends/web
Any update on this typescript support?