diff options
| author | Frank <[email protected]> | 2025-09-18 10:59:01 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-09-18 10:59:01 -0400 |
| commit | 4ceabdffa07b1af8d99eb73622a4d549d99ec6d2 (patch) | |
| tree | 72e2ae62084a9e24cc76caffbd1f30dafc69ea56 /packages/console/core/src/user.ts | |
| parent | c87480cf931a6f8f8b55552558ef521f1918b578 (diff) | |
| download | opencode-4ceabdffa07b1af8d99eb73622a4d549d99ec6d2.tar.gz opencode-4ceabdffa07b1af8d99eb73622a4d549d99ec6d2.zip | |
wip: zen
Diffstat (limited to 'packages/console/core/src/user.ts')
| -rw-r--r-- | packages/console/core/src/user.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/console/core/src/user.ts b/packages/console/core/src/user.ts new file mode 100644 index 000000000..7914926ff --- /dev/null +++ b/packages/console/core/src/user.ts @@ -0,0 +1,18 @@ +import { z } from "zod" +import { eq } from "drizzle-orm" +import { fn } from "./util/fn" +import { Database } from "./drizzle" +import { UserTable } from "./schema/user.sql" + +export namespace User { + export const fromID = fn(z.string(), async (id) => + Database.transaction(async (tx) => { + return tx + .select() + .from(UserTable) + .where(eq(UserTable.id, id)) + .execute() + .then((rows) => rows[0]) + }), + ) +} |
