You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I decided to introduce Drizzle into my hono / better-sqlite3 project.
This has caused issues because Drizzle expects operations to be asynchronous whilst better-sqlite3 is synchronous. Eslint and Typescript object to awaiting synchronous operations or not awaiting Drizzle queries. To overcome this, I made wrapper:
export function awaitable<T>(value: T | Promise<T>): Promise<T> { return Promise.resolve(value); }
This mostly works (and makes it easy to switch to asynchronous library such as libsql). But handling transactions without generating errors is difficult.
Does Drizzle plan to make better support to synchronous libraries like better-sqlite3?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I decided to introduce Drizzle into my hono / better-sqlite3 project.
This has caused issues because Drizzle expects operations to be asynchronous whilst better-sqlite3 is synchronous. Eslint and Typescript object to awaiting synchronous operations or not awaiting Drizzle queries. To overcome this, I made wrapper:
export function awaitable<T>(value: T | Promise<T>): Promise<T> { return Promise.resolve(value); }This mostly works (and makes it easy to switch to asynchronous library such as libsql). But handling transactions without generating errors is difficult.
Does Drizzle plan to make better support to synchronous libraries like better-sqlite3?
Beta Was this translation helpful? Give feedback.
All reactions