-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
33 lines (28 loc) · 857 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Client } from "@planetscale/database";
import { drizzle } from "drizzle-orm/planetscale-serverless";
import * as addresses from "./schema/addresses";
import * as categories from "./schema/categories";
import * as logOrders from "./schema/log-orders";
import * as orders from "./schema/orders";
import * as payments from "./schema/payments";
import * as products from "./schema/products";
import * as shippings from "./schema/shippings";
import * as users from "./schema/users";
export const schema = {
...users,
...products,
...categories,
...addresses,
...orders,
...payments,
...logOrders,
...shippings,
};
export { mySqlTable as tableCreator } from "./schema/_table";
export * from "drizzle-orm";
export const db = drizzle(
new Client({
url: process.env.DATABASE_URL,
}).connection(),
{ schema, logger: true },
);