summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/script
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-05 22:48:05 -0500
committerFrank <[email protected]>2026-01-05 22:48:07 -0500
commit8da890649f14d3cf78ef6c0917eae08f2b66d0c9 (patch)
treeea81edbd33cbe78f58c75778e7e2cd769bff03c3 /packages/console/core/script
parent21053732e77e7f38d0862dd2b00ad1a987a9a191 (diff)
downloadopencode-8da890649f14d3cf78ef6c0917eae08f2b66d0c9.tar.gz
opencode-8da890649f14d3cf78ef6c0917eae08f2b66d0c9.zip
wip: zen
Diffstat (limited to 'packages/console/core/script')
-rw-r--r--packages/console/core/script/lookup-user.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/console/core/script/lookup-user.ts b/packages/console/core/script/lookup-user.ts
index d0b583a18..0b8e86440 100644
--- a/packages/console/core/script/lookup-user.ts
+++ b/packages/console/core/script/lookup-user.ts
@@ -14,7 +14,7 @@ if (!identifier) {
if (identifier.startsWith("wrk_")) {
await printWorkspace(identifier)
} else {
- const authData = await printTable("Email", (tx) =>
+ const authData = await Database.use(async (tx) =>
tx.select().from(AuthTable).where(eq(AuthTable.subject, identifier)),
)
if (authData.length === 0) {
@@ -25,7 +25,7 @@ if (identifier.startsWith("wrk_")) {
// Get all auth records for email
const accountID = authData[0].accountID
- await printTable("Auth Records", (tx) => tx.select().from(AuthTable).where(eq(AuthTable.accountID, accountID)))
+ await printTable("Auth", (tx) => tx.select().from(AuthTable).where(eq(AuthTable.accountID, accountID)))
// Get all workspaces for this account
const users = await printTable("Workspaces", (tx) =>
@@ -60,6 +60,7 @@ async function printWorkspace(workspaceID: string) {
tx
.select({
balance: BillingTable.balance,
+ customerID: BillingTable.customerID,
})
.from(BillingTable)
.where(eq(BillingTable.workspaceID, workspace.id))
@@ -113,7 +114,7 @@ async function printWorkspace(workspaceID: string) {
.from(UsageTable)
.where(eq(UsageTable.workspaceID, workspace.id))
.orderBy(sql`${UsageTable.timeCreated} DESC`)
- .limit(1000)
+ .limit(10)
.then((rows) =>
rows.map((row) => ({
...row,