diff --git a/app/page.tsx b/app/page.tsx index 5705d4e..0cb67a6 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,113 +1,12 @@ -import Image from "next/image"; +import { getUsers } from "@/drizzle/db"; -export default function Home() { +export default async function Home() { + const users = await getUsers(); + console.log(users); + const name = users[0] ? users[0].name : "guest"; return ( -
-
-

- Get started by editing  - app/page.tsx -

-
- - By{" "} - Vercel Logo - -
-
- -
- Next.js Logo -
- -
- -

- Docs{" "} - - -> - -

-

- Find in-depth information about Next.js features and API. -

-
- - -

- Learn{" "} - - -> - -

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

- Templates{" "} - - -> - -

-

- Explore starter templates for Next.js. -

-
- - -

- Deploy{" "} - - -> - -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

-
-
+
+

Hello {name}!

); } diff --git a/drizzle/schema.ts b/drizzle/schema.ts index 056c734..ff48fff 100644 --- a/drizzle/schema.ts +++ b/drizzle/schema.ts @@ -7,6 +7,7 @@ import { timestamp, uniqueIndex, } from "drizzle-orm/pg-core"; +import { InferSelectModel } from "drizzle-orm"; export const UsersTable = pgTable( "users", @@ -23,3 +24,5 @@ export const UsersTable = pgTable( }; } ); + +export type Users = InferSelectModel;