summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/src
diff options
context:
space:
mode:
authorFrank <[email protected]>2025-12-01 18:33:32 -0500
committerFrank <[email protected]>2025-12-01 18:33:32 -0500
commitdc32705bc9c925427de0fcb9994993855503024f (patch)
tree92c34a208909ea82c25085ede6dd719306c56f94 /packages/console/core/src
parent1eaf5c31d3789f903fd9dec40278e3311973172f (diff)
downloadopencode-dc32705bc9c925427de0fcb9994993855503024f.tar.gz
opencode-dc32705bc9c925427de0fcb9994993855503024f.zip
zen: remove unnecessary transactions
Diffstat (limited to 'packages/console/core/src')
-rw-r--r--packages/console/core/src/account.ts11
-rw-r--r--packages/console/core/src/provider.ts2
2 files changed, 6 insertions, 7 deletions
diff --git a/packages/console/core/src/account.ts b/packages/console/core/src/account.ts
index c7e096586..6d1773b84 100644
--- a/packages/console/core/src/account.ts
+++ b/packages/console/core/src/account.ts
@@ -11,7 +11,7 @@ export namespace Account {
id: z.string().optional(),
}),
async (input) =>
- Database.transaction(async (tx) => {
+ Database.use(async (tx) => {
const id = input.id ?? Identifier.create("account")
await tx.insert(AccountTable).values({
id,
@@ -21,13 +21,12 @@ export namespace Account {
)
export const fromID = fn(z.string(), async (id) =>
- Database.transaction(async (tx) => {
- return tx
+ Database.use((tx) =>
+ tx
.select()
.from(AccountTable)
.where(eq(AccountTable.id, id))
- .execute()
- .then((rows) => rows[0])
- }),
+ .then((rows) => rows[0]),
+ ),
)
}
diff --git a/packages/console/core/src/provider.ts b/packages/console/core/src/provider.ts
index cf2040b59..a59493e1c 100644
--- a/packages/console/core/src/provider.ts
+++ b/packages/console/core/src/provider.ts
@@ -47,7 +47,7 @@ export namespace Provider {
}),
async ({ provider }) => {
Actor.assertAdmin()
- return Database.transaction((tx) =>
+ Database.use((tx) =>
tx
.delete(ProviderTable)
.where(and(eq(ProviderTable.provider, provider), eq(ProviderTable.workspaceID, Actor.workspace()))),