diff options
| author | Frank <[email protected]> | 2025-08-28 16:44:55 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-08-28 16:44:55 -0400 |
| commit | c6ef92634d0ae026a59e023e69847b481975462b (patch) | |
| tree | c88bfbbabf1f46ca922e3212dd929b34d6229a1a /cloud/core/src/user.ts | |
| parent | f97fdceb01c69ca563e755c6d50312ef7352f663 (diff) | |
| download | opencode-c6ef92634d0ae026a59e023e69847b481975462b.tar.gz opencode-c6ef92634d0ae026a59e023e69847b481975462b.zip | |
wip cloud
Diffstat (limited to 'cloud/core/src/user.ts')
| -rw-r--r-- | cloud/core/src/user.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cloud/core/src/user.ts b/cloud/core/src/user.ts new file mode 100644 index 000000000..7914926ff --- /dev/null +++ b/cloud/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]) + }), + ) +} |
