diff --git a/packages/effect-drizzle-sqlite/src/index.ts b/packages/effect-drizzle-sqlite/src/index.ts
index 57ffdecb7e..f8ffda9c9e 100644
--- a/packages/effect-drizzle-sqlite/src/index.ts
+++ b/packages/effect-drizzle-sqlite/src/index.ts
@@ -63,6 +63,10 @@ type SelectLike = EffectLikeQuery & {
readonly all: () => A
}
+type GetLike = EffectLikeQuery & {
+ readonly get: () => A
+}
+
type MutationLike = EffectLikeQuery & {
readonly all: () => A
readonly run: () => A
@@ -104,6 +108,8 @@ const fromMutation = (query: MutationLike) => fromSync(query, () => (query.confi
const fromCount = (query: CountLike) => fromSync(query, () => Number(query.session.values(query.sql)[0]?.[0] ?? 0))
+export const getOne = (query: GetLike) => fromSync(query, () => query.get())
+
const fromExecuteResult = (result: unknown) => {
if (result && typeof result === "object" && "sync" in result && typeof result.sync === "function") {
return result.sync()
@@ -155,6 +161,7 @@ const attachTransaction = <
TRelations extends AnyRelations = EmptyRelations,
>(db: SQLiteBunDatabase & { readonly $client: Database }): EffectSQLiteDatabase => {
const txStack: Array> = []
+ const bound = new WeakMap