Home / File/ softRelations.test.ts — drizzle-orm Source File

softRelations.test.ts — drizzle-orm Source File

Architecture documentation for softRelations.test.ts, a typescript file in the drizzle-orm codebase. 8 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  d4278696_c6a9_ec48_7917_918e11eb7c40["softRelations.test.ts"]
  0fabdd81_61c9_bb7c_7ddf_dde7a6071abc["index.ts"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> 0fabdd81_61c9_bb7c_7ddf_dde7a6071abc
  e2db8cff_d688_4f7a_2494_cbda1c3623cc["reset"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> e2db8cff_d688_4f7a_2494_cbda1c3623cc
  ee61d65c_3a91_eebf_195c_778a484baf2b["seed"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> ee61d65c_3a91_eebf_195c_778a484baf2b
  969861cc_29cd_39ee_e40a_c222dd6e0184["sqliteSchema.ts"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> 969861cc_29cd_39ee_e40a_c222dd6e0184
  ccd8f141_31dd_df9e_0535_43efaea4d6db["better-sqlite3"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> ccd8f141_31dd_df9e_0535_43efaea4d6db
  690f7dfc_0aea_9ee8_d6e7_26bbb3689031["drizzle-orm"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> 690f7dfc_0aea_9ee8_d6e7_26bbb3689031
  5fb205ef_438e_58ed_ca43_2d0e3ec9cd7b["better-sqlite3"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> 5fb205ef_438e_58ed_ca43_2d0e3ec9cd7b
  8d35eaf2_a542_cfd4_fa1a_fafca0f02686["vitest"]
  d4278696_c6a9_ec48_7917_918e11eb7c40 --> 8d35eaf2_a542_cfd4_fa1a_fafca0f02686
  style d4278696_c6a9_ec48_7917_918e11eb7c40 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import BetterSqlite3 from 'better-sqlite3';
import { sql } from 'drizzle-orm';
import type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
import { drizzle } from 'drizzle-orm/better-sqlite3';
import { afterAll, afterEach, beforeAll, expect, test } from 'vitest';
import { reset, seed } from '../../../src/index.ts';
import * as schema from './sqliteSchema.ts';

let client: BetterSqlite3.Database;
let db: BetterSQLite3Database;

beforeAll(async () => {
	client = new BetterSqlite3(':memory:');

	db = drizzle(client);

	db.run(
		sql.raw(`
    CREATE TABLE \`customer\` (
	\`id\` text 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
);
    `),
	);

	db.run(
		sql.raw(`
    CREATE TABLE \`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
);
    `),
	);

	db.run(
		sql.raw(`
    CREATE TABLE \`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\` integer NOT NULL,
	\`hire_date\` integer NOT NULL,
	\`address\` text NOT NULL,
	\`city\` text NOT NULL,
	\`postal_code\` text NOT NULL,
	\`country\` text NOT NULL,
// ... (194 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does softRelations.test.ts do?
softRelations.test.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleSeed domain, SeedOrchestration subdomain.
What functions are defined in softRelations.test.ts?
softRelations.test.ts defines 1 function(s): checkSoftRelations.
What does softRelations.test.ts depend on?
softRelations.test.ts imports 8 module(s): better-sqlite3, better-sqlite3, drizzle-orm, index.ts, reset, seed, sqliteSchema.ts, vitest.
Where is softRelations.test.ts in the architecture?
softRelations.test.ts is located at drizzle-seed/tests/sqlite/softRelationsTest/softRelations.test.ts (domain: DrizzleSeed, subdomain: SeedOrchestration, directory: drizzle-seed/tests/sqlite/softRelationsTest).

Analyze Your Own Codebase

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

Try Supermodel Free