Updating to 0.30.2 break my tauri Sqlite proxy
I had made tauri-drizzle-sqlite-proxy-demo which worked with drizzel version 0.29.3 but breaks with the lasted version. But I can't see what changed..
I only received undefined values from Drizzle now.
See my mapping over here: https://github.com/tdwesten/tauri-drizzle-sqlite-proxy-demo/blob/17073a4455852210856cce3ffa126bb85c0a7b27/src/db/database.ts#L26
The response from the tauri sqlite proxy is:
GitHub
tauri-drizzle-sqlite-proxy-demo/src/db/database.ts at 17073a4455852...
A Tauri app with a React front-end and a SQLite database using Drizzle ORM - tdwesten/tauri-drizzle-sqlite-proxy-demo
23 Replies
I think the drizzle is expecting a different structure. What structure should it be?
OK found it. Drizzle expects a array of values now..
GitHub
tauri-drizzle-sqlite-proxy-demo/src/db/database.ts at main · tdwest...
A Tauri app with a React front-end and a SQLite database using Drizzle ORM - tdwesten/tauri-drizzle-sqlite-proxy-demo
Nah, I was to fast..
How to get the values in the right order?
cc: @Andrew Sherman
I think we've introduced breaking changes to SQLite proxy recently, cause it was working inproperly and didn't have support for batch
and it does seem those notes are not in release and Andrew can help with them
Drizzle ORM - SQLite
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
docs should be up to date, can you please check
Yeah i think the batch feature broke the mapping.
I made a bug report issue: https://github.com/drizzle-team/drizzle-orm/issues/2021
GitHub
[BUG]: Bulk feature broke sqlite-proxy field/key mapping · Issue #2...
What version of drizzle-orm are you using? 0.30.2 What version of drizzle-kit are you using? No response Describe the Bug After updating Drizzle to version 0.30.2 from 0.29.3, the values in the res...
Will take it tomorrow or Monday
Thanks for a repro and bug ticket
Thanks!
Super helpful
NP!
@Andrew Sherman any updates?
sorry for late response
could you please check that this result is an array of arrays and not aray of objects for you?
https://github.com/tdwesten/tauri-drizzle-sqlite-proxy-demo/blob/main/src/db/database.ts#L42
Hi @Andrew Sherman, that's the problem. Drizzle accepted >= 0.29.3 a
{row: object[]}
The tauri-plugin-sql-api
returns a object 🙂
So I need to map the schema key index to the right index in the array to match the results.
I have it working now, but only when the schema keys are sorted in ascending order. Otherwise, the values in the response do not match up.
this was the fix:
But still when you change to order of the drizzle schema it breaks...it accepts an array of arrays
you can see that I'm using
.raw()
method that makes returning raw values instead of mapped objects
https://github.com/drizzle-team/drizzle-orm/blob/main/integration-tests/tests/sqlite-proxy.test.ts#L27GitHub
drizzle-orm/integration-tests/tests/sqlite-proxy.test.ts at main · ...
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅 - drizzle-team/drizzle-orm
@Thomas van der Westen hey!
Hi! @alexblokh
we're considering using Tauri for the desktop app we're going to build but I do see that it doesn't have node as an option for the backend
is that the case?
we will have to write everything in rust?
Euhm... Rust is primary indeed but i think you can use node in a sidecar construction. But then you need to include node as a binary because NODEJS is not native.
But you can better ask here: https://discord.gg/fmTs8U42
and if we include it as binary - I suppose size will become comparable with the ElectronJS?
I think so, and your app will be big!
The power of tauri is how small the apps are (simple apps can be 3mb)