wip cloud

This commit is contained in:
Frank
2025-08-28 16:44:55 -04:00
parent f97fdceb01
commit c6ef92634d
5 changed files with 372 additions and 12 deletions

18
cloud/core/src/user.ts Normal file
View File

@@ -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])
}),
)
}