Thomas van der Westen
Thomas van der Westen
Explore posts from servers
DTDrizzle Team
Created by Thomas van der Westen on 3/16/2024 in #help
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"}
40 replies
DTDrizzle Team
Created by Thomas van der Westen on 12/26/2023 in #help
What structure is expected when using the http-proxy?
When I run this code i get a object with a empty id and name.
const db = drizzle(async (sql, params, method) => {
const result = await database.select(sql, params);

return {
rows: [
{
id: "1231",
name: "1231",
},
],
};
});

const results = await db
.select({
id: this.getDrizzleSchema().id,
name: this.getDrizzleSchema().name,
})
.from(this.getDrizzleSchema())
.execute();
const db = drizzle(async (sql, params, method) => {
const result = await database.select(sql, params);

return {
rows: [
{
id: "1231",
name: "1231",
},
],
};
});

const results = await db
.select({
id: this.getDrizzleSchema().id,
name: this.getDrizzleSchema().name,
})
.from(this.getDrizzleSchema())
.execute();
What is the expected return value?
5 replies
DTDrizzle Team
Created by Thomas van der Westen on 12/4/2023 in #help
Can I run the `migrate()` function exporting a raw SQL query in Drizzle ORM?
I am building a Tauri app with a local SQLite database, and I have access via JavaScript. Here's an example:
const result = await db.execute(
"INSERT INTO todos (id, title, status) VALUES ($1, $2, $3)",
[todos.id, todos.title, todos.status]
);
const result = await db.execute(
"INSERT INTO todos (id, title, status) VALUES ($1, $2, $3)",
[todos.id, todos.title, todos.status]
);
Is it possible to run migrations using Drizzle in this manner?
9 replies