Skip to content

Commit

Permalink
feat: load db tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrastopoulos committed Apr 6, 2024
1 parent 6816257 commit 13a4292
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/api/src/router/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const postRouter = createTRPCRouter({
// .select()
// .from(schema.post)
// .where(eq(schema.post.id, input.id));

return ctx.db.query.post.findFirst({
where: eq(schema.post.id, input.id),
});
Expand Down
37 changes: 36 additions & 1 deletion packages/db/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,44 @@ import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

import * as auth from "./schema/auth";
import * as bookmark from "./schema/bookmark";
import * as checkin from "./schema/checkin";
import * as checkinItem from "./schema/checkinItem";
import * as confirmation from "./schema/confirmation";
import * as email from "./schema/email";
import * as event from "./schema/event";
import * as post from "./schema/post";
import * as prize from "./schema/prize";
import * as profile from "./schema/profile";
import * as project from "./schema/project";
import * as recruiter from "./schema/recruiter";
import * as scheduleItem from "./schema/scheduleItem";
import * as settings from "./schema/settings";
import * as sponsor from "./schema/sponsor";
import * as team from "./schema/team";
import * as teamRequest from "./schema/teamRequest";
import * as user from "./schema/user";

export const schema = { ...auth, ...post };
export const schema = {
...auth,
...post,
...user,
...profile,
...team,
...teamRequest,
...event,
...checkin,
...checkinItem,
...prize,
...project,
...sponsor,
...recruiter,
...email,
...confirmation,
...settings,
...scheduleItem,
...bookmark,
};

export { pgTable as tableCreator } from "./schema/_table";

Expand Down

0 comments on commit 13a4292

Please sign in to comment.