Home / Function/ createNorthwindTables() — drizzle-orm Function Reference

createNorthwindTables() — drizzle-orm Function Reference

Architecture documentation for the createNorthwindTables() function in pg.test.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  cb0f85e5_2af5_3245_eafd_f33061d53f43["createNorthwindTables()"]
  6ef82130_edcf_b07d_9560_377d0fd25ee7["pg.test.ts"]
  cb0f85e5_2af5_3245_eafd_f33061d53f43 -->|defined in| 6ef82130_edcf_b07d_9560_377d0fd25ee7
  style cb0f85e5_2af5_3245_eafd_f33061d53f43 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

integration-tests/tests/seeder/pg.test.ts lines 12–178

const createNorthwindTables = async () => {
	await db.execute(
		sql`
			    CREATE TABLE IF NOT EXISTS "seeder_lib_pg"."customer" (
				"id" varchar(256) PRIMARY KEY NOT NULL,
				"company_name" text NOT NULL,
				"contact_name" text NOT NULL,
				"contact_title" text NOT NULL,
				"address" text NOT NULL,
				"city" text NOT NULL,
				"postal_code" text,
				"region" text,
				"country" text NOT NULL,
				"phone" text NOT NULL,
				"fax" text
			);
		`,
	);

	await db.execute(
		sql`
			    CREATE TABLE IF NOT EXISTS "seeder_lib_pg"."order_detail" (
				"unit_price" numeric NOT NULL,
				"quantity" integer NOT NULL,
				"discount" numeric NOT NULL,
				"order_id" integer NOT NULL,
				"product_id" integer NOT NULL
			);
		`,
	);

	await db.execute(
		sql`
			    CREATE TABLE IF NOT EXISTS "seeder_lib_pg"."employee" (
				"id" integer PRIMARY KEY NOT NULL,
				"last_name" text NOT NULL,
				"first_name" text,
				"title" text NOT NULL,
				"title_of_courtesy" text NOT NULL,
				"birth_date" timestamp NOT NULL,
				"hire_date" timestamp NOT NULL,
				"address" text NOT NULL,
				"city" text NOT NULL,
				"postal_code" text NOT NULL,
				"country" text NOT NULL,
				"home_phone" text NOT NULL,
				"extension" integer NOT NULL,
				"notes" text NOT NULL,
				"reports_to" integer,
				"photo_path" text
			);
		`,
	);

	await db.execute(
		sql`
			    CREATE TABLE IF NOT EXISTS "seeder_lib_pg"."order" (
				"id" integer PRIMARY KEY NOT NULL,
				"order_date" timestamp NOT NULL,
				"required_date" timestamp NOT NULL,
				"shipped_date" timestamp,
				"ship_via" integer NOT NULL,
				"freight" numeric NOT NULL,
				"ship_name" text NOT NULL,
				"ship_city" text NOT NULL,
				"ship_region" text,
				"ship_postal_code" text,
				"ship_country" text NOT NULL,
				"customer_id" text NOT NULL,
				"employee_id" integer NOT NULL
			);    
		`,
	);

	await db.execute(
		sql`
			    CREATE TABLE IF NOT EXISTS "seeder_lib_pg"."product" (
				"id" integer PRIMARY KEY NOT NULL,
				"name" text NOT NULL,
				"quantity_per_unit" text NOT NULL,
				"unit_price" numeric NOT NULL,

Domain

Subdomains

Frequently Asked Questions

What does createNorthwindTables() do?
createNorthwindTables() is a function in the drizzle-orm codebase, defined in integration-tests/tests/seeder/pg.test.ts.
Where is createNorthwindTables() defined?
createNorthwindTables() is defined in integration-tests/tests/seeder/pg.test.ts at line 12.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free