diff --git a/apps/nextjs/src/app/(info)/docs/rails/page.tsx b/apps/nextjs/src/app/(info)/docs/rails/page.tsx
index 86bcffa9..ed1a2c3f 100644
--- a/apps/nextjs/src/app/(info)/docs/rails/page.tsx
+++ b/apps/nextjs/src/app/(info)/docs/rails/page.tsx
@@ -12,7 +12,7 @@ export default async function OpenApiDocs() {
return redirect("/");
}
- const me = (await getAccountMe())?.data;
+ const me = await getAccountMe();
if (!me?.admin) {
return redirect("/"); // Redirect to home page if account is not an admin)
diff --git a/apps/nextjs/src/app/api/uploadthing/core.ts b/apps/nextjs/src/app/api/uploadthing/core.ts
index 74ae7de1..d0fb201f 100644
--- a/apps/nextjs/src/app/api/uploadthing/core.ts
+++ b/apps/nextjs/src/app/api/uploadthing/core.ts
@@ -24,9 +24,12 @@ export const UploadThingRouter = {
})
.onUploadComplete(({ metadata, file }) => {
// This code RUNS ON YOUR SERVER after upload
- console.log("Upload complete for userId:", metadata.userId);
-
- console.log("file url", file.url);
+ console.log(
+ "Upload complete for userId:",
+ metadata.userId,
+ "file url",
+ file.url,
+ );
// !!! Whatever is returned here is sent to the client `onClientUploadComplete` callback
return { uploadedBy: metadata.userId };
diff --git a/apps/nextjs/src/app/dashboard/@profiles/page.tsx b/apps/nextjs/src/app/dashboard/@profiles/page.tsx
index 3281951e..507cf22c 100644
--- a/apps/nextjs/src/app/dashboard/@profiles/page.tsx
+++ b/apps/nextjs/src/app/dashboard/@profiles/page.tsx
@@ -3,13 +3,13 @@ import { getProfilesByAccountId } from "~/app/server-actions/profiles/actions";
import NewProfile from "~/components/profiles/new-profile";
export default async function Profiles() {
- const me = (await getAccountMe())?.data;
+ const me = await getAccountMe();
if (!me) {
return null;
}
- const profiles = await getProfilesByAccountId(me.id);
+ const profiles = await getProfilesByAccountId(Number(me.id));
return (
diff --git a/apps/nextjs/src/app/dashboard/layout.tsx b/apps/nextjs/src/app/dashboard/layout.tsx
index ee0226f6..28c1dae2 100644
--- a/apps/nextjs/src/app/dashboard/layout.tsx
+++ b/apps/nextjs/src/app/dashboard/layout.tsx
@@ -4,7 +4,7 @@ import { getAccountMe } from "~/app/server-actions/accounts/actions";
export default async function DashboardLayout({
children,
}: Readonly
) {
- const me = (await getAccountMe())?.data;
+ const me = await getAccountMe();
return (
diff --git a/apps/nextjs/src/app/organizations/[org_slug]/page.tsx b/apps/nextjs/src/app/organizations/[org_slug]/page.tsx
index 703efb42..a12606cc 100644
--- a/apps/nextjs/src/app/organizations/[org_slug]/page.tsx
+++ b/apps/nextjs/src/app/organizations/[org_slug]/page.tsx
@@ -17,15 +17,15 @@ export async function generateMetadata(
props: Readonly
,
) {
const params = await props.params;
- const { data: org } = await getOrganization(params.org_slug);
+ const org = await getOrganization(params.org_slug);
return { title: org?.name ?? "Organization" };
}
export async function generateStaticParams() {
- const { partners, nonpartners } = await getOrganizations();
+ const orgs = await getOrganizations();
- return [...partners, ...nonpartners].map(({ slug }) => ({ org_slug: slug }));
+ return orgs.map(({ slug }) => ({ org_slug: slug }));
}
// const columns = [
@@ -60,7 +60,7 @@ export default async function OrganizationDetailPage(
props: Readonly,
) {
const params = await props.params;
- const { data: organization } = await getOrganization(params.org_slug);
+ const organization = await getOrganization(params.org_slug);
if (!organization) {
return 404 - Not Found
;
diff --git a/apps/nextjs/src/app/organizations/[org_slug]/tournaments/[tournament_id]/(tournament_page)/page.tsx b/apps/nextjs/src/app/organizations/[org_slug]/tournaments/[tournament_id]/(tournament_page)/page.tsx
index f9b6b515..dc886d67 100644
--- a/apps/nextjs/src/app/organizations/[org_slug]/tournaments/[tournament_id]/(tournament_page)/page.tsx
+++ b/apps/nextjs/src/app/organizations/[org_slug]/tournaments/[tournament_id]/(tournament_page)/page.tsx
@@ -3,6 +3,7 @@ import Link from "next/link";
import { Chip } from "@battle-stadium/ui";
import type { OrganizationTournamentProps } from "~/types";
+import { getOrganization } from "~/app/server-actions/organizations/actions";
import {
getTournament,
getTournaments,
@@ -41,7 +42,11 @@ export default async function OrganizationTournament(
return 404 - Not Found
;
}
- const { organization } = tournament;
+ const organization = await getOrganization(tournament.organization.slug);
+
+ if (!organization) {
+ return 404 - Not Found
;
+ }
return (
<>
@@ -95,6 +100,7 @@ function TournamentDetailChips(props: Readonly) {
Light
Flat
Register
diff --git a/apps/nextjs/src/app/organizations/page.tsx b/apps/nextjs/src/app/organizations/page.tsx
index e75c6f85..3b7de9a5 100644
--- a/apps/nextjs/src/app/organizations/page.tsx
+++ b/apps/nextjs/src/app/organizations/page.tsx
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
import type { Tournament } from "~/lib/api";
import PartneredOrganizations from "~/components/organizations/partnered-organizations";
+import { getOrganizations } from "../server-actions/organizations/actions";
export const metadata: Metadata = {
title: "Organizations",
@@ -11,7 +12,8 @@ export interface OrganizationsPageProps {
orgs: Tournament[];
}
-export default function OrganizationsPage() {
+export default async function OrganizationsPage() {
+ const orgs = await getOrganizations();
return (
<>
@@ -20,6 +22,12 @@ export default function OrganizationsPage() {
TODO: Organizations Table
+ {orgs.map((org) => (
+
+
{org.name}
+
{org.description}
+
+ ))}
>
);
diff --git a/apps/nextjs/src/app/players/[username]/page.tsx b/apps/nextjs/src/app/players/[username]/page.tsx
index 9c90b100..ce640c35 100644
--- a/apps/nextjs/src/app/players/[username]/page.tsx
+++ b/apps/nextjs/src/app/players/[username]/page.tsx
@@ -1,4 +1,4 @@
-import { getAccount } from "~/app/server-actions/accounts/actions";
+import { getProfile } from "~/app/server-actions/profiles/actions";
interface PlayerProfilePageProps {
params: Promise<{
@@ -10,7 +10,7 @@ export async function generateMetadata(
props: Readonly
,
) {
const params = await props.params;
- const { data: player } = await getAccount(params.username);
+ const player = await getProfile(params.username);
return { title: player?.username ?? "Player" };
}
@@ -19,14 +19,12 @@ export default async function PlayerProfilePage(
props: Readonly,
) {
const params = await props.params;
- const { data: player } = await getAccount(params.username);
+ const player = await getProfile(params.username);
return (
{player?.username}
-
- {player?.first_name} {player?.last_name}
-
+
{player?.slug}
);
}
diff --git a/apps/nextjs/src/app/players/page.tsx b/apps/nextjs/src/app/players/page.tsx
index 5115580c..5eec151b 100644
--- a/apps/nextjs/src/app/players/page.tsx
+++ b/apps/nextjs/src/app/players/page.tsx
@@ -13,7 +13,7 @@ const columns = [
];
export default async function PlayersPage() {
- const { data: players } = await getProfiles();
+ const players = await getProfiles();
- return ;
+ return ;
}
diff --git a/apps/nextjs/src/app/players/players-table.tsx b/apps/nextjs/src/app/players/players-table.tsx
index 616292e5..054bb93a 100644
--- a/apps/nextjs/src/app/players/players-table.tsx
+++ b/apps/nextjs/src/app/players/players-table.tsx
@@ -1,12 +1,13 @@
"use client";
+import type { profiles } from "@battle-stadium/db/schema";
+
// import { type Key } from "react";
// import Link from "next/link";
-import type { Profile } from "~/lib/api";
export interface PlayersTableProps {
- players: Profile[];
+ players: (typeof profiles.$inferSelect)[];
columns: { key: string; label: string }[];
}
@@ -29,7 +30,8 @@ export default function PlayersTable({
// switch (columnKey) {
// case "username":
// return (
-//
+//
// {username}
//
// );
diff --git a/apps/nextjs/src/app/server-actions/accounts/actions.ts b/apps/nextjs/src/app/server-actions/accounts/actions.ts
index 72e2cdaa..687ebb28 100644
--- a/apps/nextjs/src/app/server-actions/accounts/actions.ts
+++ b/apps/nextjs/src/app/server-actions/accounts/actions.ts
@@ -1,49 +1,46 @@
"use server";
-import type { FetchOptions } from "openapi-fetch";
import { auth } from "@clerk/nextjs/server";
-import type { paths } from "~/lib/api/openapi-v1";
-import { BattleStadiumApiClient, defaultConfig } from "~/lib/api";
+import { db, eq } from "@battle-stadium/db";
+import { accounts, clerkUsers, profiles } from "@battle-stadium/db/schema";
-export async function getAccounts(
- options?: FetchOptions,
-) {
- const usersOptions = {
- ...defaultConfig("listUsers"),
- ...options,
- };
- const skipClerkAuth = true;
-
- return BattleStadiumApiClient(skipClerkAuth).GET("/accounts", usersOptions);
+export async function getAccounts() {
+ return await db.query.accounts.findMany();
}
-export async function getAccount(
- username: string,
- options?: FetchOptions,
-) {
- const userOptions = {
- ...defaultConfig(`getUser-${username}`),
- ...options,
- params: { path: { username } },
- };
-
- return BattleStadiumApiClient().GET("/accounts/{username}", userOptions);
+export async function getAccount(username: string) {
+ const profile = await db.query.profiles.findFirst({
+ where: eq(profiles.username, username),
+ });
+
+ if (!profile?.accountId) {
+ return null;
+ }
+
+ return await db.query.accounts.findFirst({
+ where: eq(accounts.id, BigInt(profile.accountId)),
+ });
}
-export async function getAccountMe(
- options?: FetchOptions,
-) {
+export async function getAccountMe() {
const { userId } = await auth();
if (!userId) {
return null;
}
- const userMeOptions = {
- ...defaultConfig(`getAccountMe(${userId})`),
- ...options,
- };
+ const clerkUser = await db.query.clerkUsers.findFirst({
+ where: eq(clerkUsers.clerkUserId, userId),
+ });
+
+ if (!clerkUser?.accountId) {
+ return null;
+ }
+
+ const account = await db.query.accounts.findFirst({
+ where: eq(accounts.id, BigInt(clerkUser.accountId)),
+ });
- return BattleStadiumApiClient().GET("/accounts/me", userMeOptions);
+ return account;
}
diff --git a/apps/nextjs/src/app/server-actions/organizations/actions.ts b/apps/nextjs/src/app/server-actions/organizations/actions.ts
index 8e2067f8..1c97f66e 100644
--- a/apps/nextjs/src/app/server-actions/organizations/actions.ts
+++ b/apps/nextjs/src/app/server-actions/organizations/actions.ts
@@ -1,51 +1,24 @@
"use server";
-import type { FetchOptions } from "openapi-fetch";
+import { eq } from "@battle-stadium/db";
+import { db } from "@battle-stadium/db/client";
+import { organizations } from "@battle-stadium/db/schema";
-import type { paths } from "~/lib/api/openapi-v1";
-import { BattleStadiumApiClient, defaultConfig } from "~/lib/api";
-
-export async function getOrganizations(
- options?: FetchOptions,
-) {
- const organizationsOptions = {
- ...defaultConfig("getOrganizations"),
- ...options,
- params: {
- query: {
- page: options?.params.query.page ?? 0,
- per_page: options?.params.query.per_page ?? 20,
- },
- },
- };
- const skipClerkAuth = true;
-
- const resp = await BattleStadiumApiClient(skipClerkAuth).GET(
- "/organizations",
- organizationsOptions,
- );
- const allOrgs = resp.data?.data;
- const partnerOrgs = (allOrgs ?? []).filter((org) => org.partner);
- const nonPartnerOrgs = (allOrgs ?? []).filter((org) => !org.partner);
-
- return {
- partners: partnerOrgs,
- nonpartners: nonPartnerOrgs,
- };
+export async function getOrganizations() {
+ const orgs = await db.query.organizations.findMany();
+ return orgs;
}
-export async function getOrganization(
- slug: string,
- options?: FetchOptions,
-) {
- const organizationOptions = {
- ...defaultConfig(`getOrganization(${slug})`),
- ...options,
- params: { path: { slug } },
- };
+export async function getPartneredOrganizations() {
+ const orgs = await db.query.organizations.findMany({
+ where: eq(organizations.partner, true),
+ });
+ return orgs;
+}
- return BattleStadiumApiClient().GET(
- "/organizations/{slug}",
- organizationOptions,
- );
+export async function getOrganization(slug: string) {
+ const org = await db.query.organizations.findFirst({
+ where: eq(organizations.slug, slug),
+ });
+ return org;
}
diff --git a/apps/nextjs/src/app/server-actions/profiles/actions.ts b/apps/nextjs/src/app/server-actions/profiles/actions.ts
index b49b2713..ffe16326 100644
--- a/apps/nextjs/src/app/server-actions/profiles/actions.ts
+++ b/apps/nextjs/src/app/server-actions/profiles/actions.ts
@@ -3,18 +3,20 @@
import type { FetchOptions } from "openapi-fetch";
import { revalidateTag } from "next/cache";
+import { db, eq } from "@battle-stadium/db";
+import { profiles } from "@battle-stadium/db/schema";
+
import type { paths } from "~/lib/api/openapi-v1";
import { BattleStadiumApiClient, defaultConfig } from "~/lib/api";
-export async function getProfiles(
- options?: FetchOptions,
-) {
- const profilesOptions = {
- ...defaultConfig("getPlayerProfiles"),
- ...options,
- };
+export async function getProfiles() {
+ return await db.query.profiles.findMany();
+}
- return BattleStadiumApiClient().GET("/profiles", profilesOptions);
+export async function getProfile(username: string) {
+ return await db.query.profiles.findFirst({
+ where: eq(profiles.username, username),
+ });
}
export async function getProfilesByAccountId(
diff --git a/apps/nextjs/src/components/battle-stadium.tsx b/apps/nextjs/src/components/battle-stadium.tsx
index 4f3ba5d6..a9990bd3 100644
--- a/apps/nextjs/src/components/battle-stadium.tsx
+++ b/apps/nextjs/src/components/battle-stadium.tsx
@@ -32,7 +32,7 @@ export default function BattleStadium() {
className="flex flex-row gap-2 md:gap-4"
>
-
+
We use cookies to provide the best experience. By continuing to use
our site, you agree to our
-
+
Cookie Policy.
diff --git a/apps/nextjs/src/components/footer.tsx b/apps/nextjs/src/components/footer.tsx
index 1ed5df65..cbe6cd90 100644
--- a/apps/nextjs/src/components/footer.tsx
+++ b/apps/nextjs/src/components/footer.tsx
@@ -54,7 +54,12 @@ export default function Footer() {
{navLinks.map((item) => (
-
+
{item.name}
))}
@@ -62,7 +67,12 @@ export default function Footer() {
{/*
*/}
{socialItems.map((item) => (
-
+
{item.name}
diff --git a/apps/nextjs/src/components/navbar/navbar-link.tsx b/apps/nextjs/src/components/navbar/navbar-link.tsx
index 4c1871a4..89b0a9af 100644
--- a/apps/nextjs/src/components/navbar/navbar-link.tsx
+++ b/apps/nextjs/src/components/navbar/navbar-link.tsx
@@ -26,10 +26,11 @@ export default function NavbarLink({
href,
label,
className,
-}: NavbarLinkProps) {
+}: Readonly
) {
const pathname = usePathname();
return (
{NavbarItemsConfigs.map(({ label, value }) => (
setIsMobileMenuOpen(false)}
diff --git a/apps/nextjs/src/components/navbar/navbar-right-menu.tsx b/apps/nextjs/src/components/navbar/navbar-right-menu.tsx
index 7e952b36..047dca1a 100644
--- a/apps/nextjs/src/components/navbar/navbar-right-menu.tsx
+++ b/apps/nextjs/src/components/navbar/navbar-right-menu.tsx
@@ -10,7 +10,7 @@ import UserMenu from "./user-menu/user-menu";
export default async function RightMenu() {
const clerkAuth = await auth();
- const me = (await getAccountMe())?.data;
+ const me = await getAccountMe();
return (
@@ -22,7 +22,7 @@ export default async function RightMenu() {
/>
-
+
-
+
Signed in as
- {`${me?.first_name} ${me?.last_name}`}
{" "}
+ {`${me?.firstName} ${me?.lastName}`}
{" "}
@@ -58,7 +58,9 @@ export default function UserMenuDropDown({
hidden: !(me && isSignedIn) || !me.admin,
})}
>
- Admin
+
+ Admin
+
- Settings
+
+ Settings
+
diff --git a/apps/nextjs/src/components/navbar/user-menu/user-menu.tsx b/apps/nextjs/src/components/navbar/user-menu/user-menu.tsx
index 33754836..67fc3c0e 100644
--- a/apps/nextjs/src/components/navbar/user-menu/user-menu.tsx
+++ b/apps/nextjs/src/components/navbar/user-menu/user-menu.tsx
@@ -1,5 +1,6 @@
import { currentUser } from "@clerk/nextjs/server";
+import type { accounts } from "@battle-stadium/db/schema";
import {
Avatar,
AvatarFallback,
@@ -8,11 +9,10 @@ import {
DropdownMenuTrigger,
} from "@battle-stadium/ui";
-import type { AccountMe } from "~/lib/api";
import UserMenuDropDown from "~/components/navbar/user-menu/user-menu-dropdown";
interface UserMenuProps {
- me?: AccountMe;
+ me?: typeof accounts.$inferSelect | null;
isSignedIn: boolean;
}
diff --git a/apps/nextjs/src/components/organizations/organization-card.tsx b/apps/nextjs/src/components/organizations/organization-card.tsx
index 816b3e5c..456270e8 100644
--- a/apps/nextjs/src/components/organizations/organization-card.tsx
+++ b/apps/nextjs/src/components/organizations/organization-card.tsx
@@ -1,11 +1,12 @@
import Link from "next/link";
-import type { Organization } from "~/lib/api";
+import type { organizations } from "@battle-stadium/db/schema";
+
import { cn } from "~/lib/utils";
import OrganizationLogo from "./organization-logo";
export interface OrgCardProps {
- organization: Organization;
+ organization: typeof organizations.$inferSelect;
disableHover?: boolean;
}
@@ -18,6 +19,7 @@ export default function OrganizationCard({
return (
diff --git a/apps/nextjs/src/components/organizations/organization-header.tsx b/apps/nextjs/src/components/organizations/organization-header.tsx
index d7f1f058..88bc6293 100644
--- a/apps/nextjs/src/components/organizations/organization-header.tsx
+++ b/apps/nextjs/src/components/organizations/organization-header.tsx
@@ -1,11 +1,12 @@
import type { ReactNode } from "react";
-import type { Organization } from "~/lib/api";
+import type { organizations } from "@battle-stadium/db/schema";
+
import OrganizationLogo from "./organization-logo";
interface OrganizationHeaderProps {
children: ReactNode;
- organization: Organization;
+ organization: typeof organizations.$inferSelect;
}
const HEIGHT_WIDTH = 175;
diff --git a/apps/nextjs/src/components/organizations/organization-logo.tsx b/apps/nextjs/src/components/organizations/organization-logo.tsx
index 644b59ff..c92c3efe 100644
--- a/apps/nextjs/src/components/organizations/organization-logo.tsx
+++ b/apps/nextjs/src/components/organizations/organization-logo.tsx
@@ -1,13 +1,13 @@
import type { PlaceholderValue } from "next/dist/shared/lib/get-img-props";
import Image from "next/image";
-import type { Organization } from "~/lib/api";
+import type { organizations } from "@battle-stadium/db/schema";
interface OrganizationLogoProps {
alt?: string;
src?: string;
priority?: boolean;
- organization: Organization;
+ organization: typeof organizations.$inferSelect;
className?: string;
logoSize: number;
blurDataURL?: string;
@@ -27,14 +27,14 @@ export default function OrganizationLogo({
}: Readonly
) {
return (
);
diff --git a/apps/nextjs/src/components/organizations/partnered-organizations.tsx b/apps/nextjs/src/components/organizations/partnered-organizations.tsx
index c921f78e..255a42ea 100644
--- a/apps/nextjs/src/components/organizations/partnered-organizations.tsx
+++ b/apps/nextjs/src/components/organizations/partnered-organizations.tsx
@@ -1,12 +1,12 @@
-import { getOrganizations } from "~/app/server-actions/organizations/actions";
+import { getPartneredOrganizations } from "~/app/server-actions/organizations/actions";
import OrganizationCard from "~/components/organizations/organization-card";
export default async function PartneredOrganizations() {
- const { partners } = await getOrganizations();
+ const orgs = await getPartneredOrganizations();
return (
- {partners.map((organization) => (
+ {orgs.map((organization) => (
) {
const router = useRouter();
const handleSubmit = async (formData: FormData) => {
- await createProfile(formData.get("profile") as string, me.id);
+ await createProfile(formData.get("profile") as string, Number(me.id));
router.push("/dashboard?tab=profiles");
};
diff --git a/apps/nextjs/src/components/tournaments/tournament-registration.tsx b/apps/nextjs/src/components/tournaments/tournament-registration.tsx
index 4d6c05d0..e77ea73f 100644
--- a/apps/nextjs/src/components/tournaments/tournament-registration.tsx
+++ b/apps/nextjs/src/components/tournaments/tournament-registration.tsx
@@ -13,13 +13,13 @@ export default async function TournamentRegistration({
org_slug,
tournament_id,
}: Readonly) {
- const me = (await getAccountMe())?.data;
+ const me = await getAccountMe();
if (!me) {
redirect("/sign-in");
}
- const profiles = await getProfilesByAccountId(me.id);
+ const profiles = await getProfilesByAccountId(Number(me.id));
return (
{
export const api = createTRPCReact();
-export function TRPCReactProvider(props: { children: React.ReactNode }) {
+export function TRPCReactProvider(
+ props: Readonly<{ children: React.ReactNode }>,
+) {
const queryClient = getQueryClient();
const [trpcClient] = useState(() =>
diff --git a/packages/api/src/root.ts b/packages/api/src/root.ts
index 20d5ac88..62181545 100644
--- a/packages/api/src/root.ts
+++ b/packages/api/src/root.ts
@@ -1,10 +1,12 @@
import { accountsRouter } from "./router/accounts";
import { authRouter } from "./router/auth";
+import { organizationsRouter } from "./router/organizations";
import { createTRPCRouter } from "./trpc";
export const appRouter = createTRPCRouter({
auth: authRouter,
accounts: accountsRouter,
+ organizations: organizationsRouter,
});
// export type definition of API
diff --git a/packages/api/src/router/organizations.ts b/packages/api/src/router/organizations.ts
new file mode 100644
index 00000000..71cf275a
--- /dev/null
+++ b/packages/api/src/router/organizations.ts
@@ -0,0 +1,18 @@
+import type { TRPCRouterRecord } from "@trpc/server";
+
+import { eq } from "@battle-stadium/db";
+import { organizations } from "@battle-stadium/db/schema";
+
+import { publicProcedure } from "../trpc";
+
+export const organizationsRouter = {
+ getOrganizations: publicProcedure.query(({ ctx }) => {
+ return ctx.db.query.organizations.findMany();
+ }),
+
+ getPartneredOrganizations: publicProcedure.query(({ ctx }) => {
+ return ctx.db.query.organizations.findMany({
+ where: eq(organizations.partner, true),
+ });
+ }),
+} satisfies TRPCRouterRecord;
diff --git a/packages/db/package.json b/packages/db/package.json
index 32801b75..889f0cd9 100644
--- a/packages/db/package.json
+++ b/packages/db/package.json
@@ -15,7 +15,7 @@
},
"./schema": {
"types": "./dist/schema.d.ts",
- "default": "./drizzle/schema.ts"
+ "default": "./src/schema.ts"
}
},
"scripts": {
@@ -35,6 +35,7 @@
"dependencies": {
"@neondatabase/serverless": "^0.10.3",
"drizzle-orm": "^0.35.1",
+ "drizzle-typebox": "^0.1.1",
"drizzle-zod": "^0.5.1",
"zod": "catalog:"
},
diff --git a/packages/db/src/index.ts b/packages/db/src/index.ts
index f0585be4..cb78e32e 100644
--- a/packages/db/src/index.ts
+++ b/packages/db/src/index.ts
@@ -1,2 +1,5 @@
+export * from "drizzle-kit";
+export * from "drizzle-orm";
export * from "drizzle-orm/sql";
export { alias } from "drizzle-orm/pg-core";
+export * from "./client";
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a430e737..0a162ff3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -117,7 +117,7 @@ importers:
version: 1.13.0
nitropack:
specifier: ^2.9.7
- version: 2.10.3(@planetscale/database@1.19.0)(@upstash/redis@1.34.3)(drizzle-orm@0.36.1(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(mysql2@3.11.3)(typescript@5.6.3)(webpack-sources@3.2.3)
+ version: 2.10.3(@planetscale/database@1.19.0)(@upstash/redis@1.34.3)(drizzle-orm@0.36.1(@planetscale/database@1.19.0)(mysql2@3.11.3))(mysql2@3.11.3)(typescript@5.6.3)(webpack-sources@3.2.3)
prettier:
specifier: 'catalog:'
version: 3.3.3
@@ -535,10 +535,13 @@ importers:
version: 0.10.3
drizzle-orm:
specifier: ^0.35.1
- version: 0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1)
+ version: 0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1)
+ drizzle-typebox:
+ specifier: ^0.1.1
+ version: 0.1.1(@sinclair/typebox@0.27.8)(drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))
drizzle-zod:
specifier: ^0.5.1
- version: 0.5.1(drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8)
+ version: 0.5.1(drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8)
zod:
specifier: 'catalog:'
version: 3.23.8
@@ -5663,6 +5666,12 @@ packages:
sqlite3:
optional: true
+ drizzle-typebox@0.1.1:
+ resolution: {integrity: sha512-eNIDe+EOCB96/bbRHOPbrC+bsuCXFd2H0/96Fl0cJkY+NKnu2qLTnGI6ILXPbyu82Yr1tsShlzDypw+VeCDqaQ==}
+ peerDependencies:
+ '@sinclair/typebox': '>=0.17.6'
+ drizzle-orm: '>=0.23.13'
+
drizzle-zod@0.5.1:
resolution: {integrity: sha512-C/8bvzUH/zSnVfwdSibOgFjLhtDtbKYmkbPbUCq46QZyZCH6kODIMSOgZ8R7rVjoI+tCj3k06MRJMDqsIeoS4A==}
peerDependencies:
@@ -11807,7 +11816,7 @@ snapshots:
dependencies:
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
- '@types/node': 20.17.6
+ '@types/node': 22.9.0
'@types/yargs': 15.0.19
chalk: 4.1.2
optional: true
@@ -13789,7 +13798,7 @@ snapshots:
'@types/pg@8.11.10':
dependencies:
- '@types/node': 20.17.6
+ '@types/node': 22.9.0
pg-protocol: 1.7.0
pg-types: 4.0.2
optional: true
@@ -13983,7 +13992,7 @@ snapshots:
- encoding
- supports-color
- '@vercel/postgres@0.10.0(utf-8-validate@6.0.4)':
+ '@vercel/postgres@0.10.0':
dependencies:
'@neondatabase/serverless': 0.9.5
bufferutil: 4.0.8
@@ -14942,9 +14951,9 @@ snapshots:
date-fns@4.1.0: {}
- db0@0.2.1(drizzle-orm@0.36.1(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(mysql2@3.11.3):
+ db0@0.2.1(drizzle-orm@0.36.1(@planetscale/database@1.19.0)(mysql2@3.11.3))(mysql2@3.11.3):
optionalDependencies:
- drizzle-orm: 0.36.1(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1)
+ drizzle-orm: 0.36.1(@planetscale/database@1.19.0)(mysql2@3.11.3)
mysql2: 3.11.3
debug@2.6.9:
@@ -15119,7 +15128,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1):
+ drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1):
dependencies:
'@libsql/client-wasm': 0.14.0
optionalDependencies:
@@ -15128,28 +15137,25 @@ snapshots:
'@planetscale/database': 1.19.0
'@types/pg': 8.11.10
'@types/react': 18.3.11
- '@vercel/postgres': 0.10.0(utf-8-validate@6.0.4)
+ '@vercel/postgres': 0.10.0
mysql2: 3.11.3
postgres: 3.4.4
react: 18.3.1
- drizzle-orm@0.36.1(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1):
+ drizzle-orm@0.36.1(@planetscale/database@1.19.0)(mysql2@3.11.3):
optionalDependencies:
- '@libsql/client-wasm': 0.14.0
- '@neondatabase/serverless': 0.10.3
- '@opentelemetry/api': 1.9.0
'@planetscale/database': 1.19.0
- '@types/pg': 8.11.10
- '@types/react': 18.3.11
- '@vercel/postgres': 0.10.0(utf-8-validate@6.0.4)
mysql2: 3.11.3
- postgres: 3.4.4
- react: 18.3.1
optional: true
- drizzle-zod@0.5.1(drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8):
+ drizzle-typebox@0.1.1(@sinclair/typebox@0.27.8)(drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1)):
+ dependencies:
+ '@sinclair/typebox': 0.27.8
+ drizzle-orm: 0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1)
+
+ drizzle-zod@0.5.1(drizzle-orm@0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8):
dependencies:
- drizzle-orm: 0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1)
+ drizzle-orm: 0.35.3(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0)(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1)
zod: 3.23.8
duplexer@0.1.2: {}
@@ -17540,7 +17546,7 @@ snapshots:
nice-try@1.0.5: {}
- nitropack@2.10.3(@planetscale/database@1.19.0)(@upstash/redis@1.34.3)(drizzle-orm@0.36.1(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(mysql2@3.11.3)(typescript@5.6.3)(webpack-sources@3.2.3):
+ nitropack@2.10.3(@planetscale/database@1.19.0)(@upstash/redis@1.34.3)(drizzle-orm@0.36.1(@planetscale/database@1.19.0)(mysql2@3.11.3))(mysql2@3.11.3)(typescript@5.6.3)(webpack-sources@3.2.3):
dependencies:
'@cloudflare/kv-asset-handler': 0.3.4
'@netlify/functions': 2.8.2
@@ -17564,7 +17570,7 @@ snapshots:
cookie-es: 1.2.2
croner: 9.0.0
crossws: 0.3.1
- db0: 0.2.1(drizzle-orm@0.36.1(@libsql/client-wasm@0.14.0)(@neondatabase/serverless@0.10.3)(@opentelemetry/api@1.9.0)(@planetscale/database@1.19.0)(@types/pg@8.11.10)(@types/react@18.3.11)(@vercel/postgres@0.10.0(utf-8-validate@6.0.4))(mysql2@3.11.3)(postgres@3.4.4)(react@18.3.1))(mysql2@3.11.3)
+ db0: 0.2.1(drizzle-orm@0.36.1(@planetscale/database@1.19.0)(mysql2@3.11.3))(mysql2@3.11.3)
defu: 6.1.4
destr: 2.0.3
dot-prop: 9.0.0