MCPcopy
hub / github.com/drizzle-team/drizzle-orm / createNorthwindTables

Function createNorthwindTables

integration-tests/tests/seeder/pg.test.ts:12–178  ·  integration-tests/tests/seeder/pg.test.ts::createNorthwindTables
()

Source from the content-addressed store, hash-verified

10let db: PgliteDatabase;
11
12const createNorthwindTables = async () => {
13 await db.execute(
14 sql`
15 CREATE TABLE IF NOT EXISTS class="st">"seeder_lib_pg".class="st">"customer" (
16 class="st">"id" varchar(256) PRIMARY KEY NOT NULL,
17 class="st">"company_name" text NOT NULL,
18 class="st">"contact_name" text NOT NULL,
19 class="st">"contact_title" text NOT NULL,
20 class="st">"address" text NOT NULL,
21 class="st">"city" text NOT NULL,
22 class="st">"postal_code" text,
23 class="st">"region" text,
24 class="st">"country" text NOT NULL,
25 class="st">"phone" text NOT NULL,
26 class="st">"fax" text
27 );
28 `,
29 );
30
31 await db.execute(
32 sql`
33 CREATE TABLE IF NOT EXISTS class="st">"seeder_lib_pg".class="st">"order_detail" (
34 class="st">"unit_price" numeric NOT NULL,
35 class="st">"quantity" integer NOT NULL,
36 class="st">"discount" numeric NOT NULL,
37 class="st">"order_id" integer NOT NULL,
38 class="st">"product_id" integer NOT NULL
39 );
40 `,
41 );
42
43 await db.execute(
44 sql`
45 CREATE TABLE IF NOT EXISTS class="st">"seeder_lib_pg".class="st">"employee" (
46 class="st">"id" integer PRIMARY KEY NOT NULL,
47 class="st">"last_name" text NOT NULL,
48 class="st">"first_name" text,
49 class="st">"title" text NOT NULL,
50 class="st">"title_of_courtesy" text NOT NULL,
51 class="st">"birth_date" timestamp NOT NULL,
52 class="st">"hire_date" timestamp NOT NULL,
53 class="st">"address" text NOT NULL,
54 class="st">"city" text NOT NULL,
55 class="st">"postal_code" text NOT NULL,
56 class="st">"country" text NOT NULL,
57 class="st">"home_phone" text NOT NULL,
58 class="st">"extension" integer NOT NULL,
59 class="st">"notes" text NOT NULL,
60 class="st">"reports_to" integer,
61 class="st">"photo_path" text
62 );
63 `,
64 );
65
66 await db.execute(
67 sql`
68 CREATE TABLE IF NOT EXISTS class="st">"seeder_lib_pg".class="st">"order" (
69 class="st">"id" integer PRIMARY KEY NOT NULL,

Callers 1

pg.test.tsFile · 0.70

Calls 2

sqlFunction · 0.90
executeMethod · 0.45

Tested by

no test coverage detected