feat: add drizzle

This commit is contained in:
Max Koon
2025-10-14 19:06:52 -04:00
parent 032f38b711
commit e27a48edb5
20 changed files with 920 additions and 77 deletions

View File

@@ -1,7 +1,7 @@
import { syncedQueryWithContext } from "@rocicorp/zero";
import { z } from "zod";
import { builder } from "@money/shared";
import type { AuthData } from "./auth";
import { type AuthData } from "./auth";
import { isLoggedIn } from "./zql";
export const queries = {
@@ -12,4 +12,10 @@ export const queries = {
.limit(10)
}
),
me: syncedQueryWithContext('me', z.tuple([]), (authData: AuthData | null) => {
isLoggedIn(authData);
return builder.users
.where('id', '=', authData.user.id)
.one();
})
};