mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
fixed drizzle rust logic
This commit is contained in:
@ -38,6 +38,7 @@ export const useWorkspaceStore = defineStore('workspaceStore', () => {
|
||||
.from(haexWorkspaces)
|
||||
.orderBy(asc(haexWorkspaces.position))
|
||||
|
||||
console.log('loadWorkspacesAsync', items)
|
||||
workspaces.value = items
|
||||
|
||||
// Create default workspace if none exist
|
||||
|
||||
@ -142,7 +142,10 @@ const drizzleCallback = (async (
|
||||
|
||||
if (isSelectQuery(sql)) {
|
||||
// SELECT statements
|
||||
rows = await invoke<unknown[]>('sql_select', { sql, params }).catch((e) => {
|
||||
rows = await invoke<unknown[]>('sql_select_with_crdt', {
|
||||
sql,
|
||||
params,
|
||||
}).catch((e) => {
|
||||
console.error('SQL select Error:', e, sql, params)
|
||||
return []
|
||||
})
|
||||
@ -164,9 +167,9 @@ const drizzleCallback = (async (
|
||||
console.error('SQL execute with CRDT Error:', e, sql, params, rows)
|
||||
return []
|
||||
})
|
||||
return { rows: undefined }
|
||||
}
|
||||
|
||||
console.log('drizzle found', rows)
|
||||
if (method === 'get') {
|
||||
return { rows: rows.length > 0 ? [rows[0]] : [] }
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user