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.
0 {id: undefined, name: undefined}
1 {id: undefined, name: undefined}
2 {id: undefined, name: undefined}
3 {id: undefined, name: undefined}
0 {id: undefined, name: undefined}
1 {id: undefined, name: undefined}
2 {id: undefined, name: undefined}
3 {id: undefined, name: undefined}
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:
0 {id: 1, name: "thomas"}
1 {id: 2, name: "Thomas van der Westen"}
2 {id: 3, name: "test"}
3 {id: 4, name: "Thomas van der Westen"}
0 {id: 1, name: "thomas"}
1 {id: 2, name: "Thomas van der Westen"}
2 {id: 3, name: "test"}
3 {id: 4, name: "Thomas van der Westen"}
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
Thomas van der Westen
Thomas van der WestenOP•9mo ago
I think the drizzle is expecting a different structure. What structure should it be? OK found it. Drizzle expects a array of values now..
Thomas van der Westen
Thomas van der WestenOP•9mo ago
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
Thomas van der Westen
Thomas van der WestenOP•9mo ago
Nah, I was to fast.. How to get the values in the right order?
Thomas van der Westen
Thomas van der WestenOP•9mo ago
No description
alexblokh
alexblokh•9mo ago
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
alexblokh
alexblokh•9mo ago
Drizzle ORM - SQLite
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
alexblokh
alexblokh•9mo ago
docs should be up to date, can you please check
Thomas van der Westen
Thomas van der WestenOP•9mo ago
Yeah i think the batch feature broke the mapping.
Thomas van der Westen
Thomas van der WestenOP•9mo ago
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...
Andrii Sherman
Andrii Sherman•9mo ago
Will take it tomorrow or Monday Thanks for a repro and bug ticket
Thomas van der Westen
Thomas van der WestenOP•9mo ago
Thanks!
Andrii Sherman
Andrii Sherman•9mo ago
Super helpful
Thomas van der Westen
Thomas van der WestenOP•9mo ago
NP! @Andrew Sherman any updates?
Andrii Sherman
Andrii Sherman•8mo ago
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
Thomas van der Westen
Thomas van der WestenOP•8mo ago
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:
rows = rows.map((row: any) => {
return Object.values(row);
});
rows = rows.map((row: any) => {
return Object.values(row);
});
But still when you change to order of the drizzle schema it breaks...
Andrii Sherman
Andrii Sherman•8mo ago
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#L27
GitHub
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
alexblokh
alexblokh•8mo ago
@Thomas van der Westen hey!
Thomas van der Westen
Thomas van der WestenOP•8mo ago
Hi! @alexblokh
alexblokh
alexblokh•8mo ago
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?
Thomas van der Westen
Thomas van der WestenOP•8mo ago
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
alexblokh
alexblokh•8mo ago
and if we include it as binary - I suppose size will become comparable with the ElectronJS?
Thomas van der Westen
Thomas van der WestenOP•8mo ago
I think so, and your app will be big! The power of tauri is how small the apps are (simple apps can be 3mb)
Want results from more Discord servers?
Add your server