Home / File/ sqlite-tables.test.ts — drizzle-orm Source File

sqlite-tables.test.ts — drizzle-orm Source File

Architecture documentation for sqlite-tables.test.ts, a typescript file in the drizzle-orm codebase. 5 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  e03ff09a_ddea_4c40_090c_ef904fc5f3c5["sqlite-tables.test.ts"]
  fb6b4a65_030b_ce6b_df0d_2be21adcd2b3["schemaDiffer.ts"]
  e03ff09a_ddea_4c40_090c_ef904fc5f3c5 --> fb6b4a65_030b_ce6b_df0d_2be21adcd2b3
  843d184b_68ea_28e0_a4e7_11ed8d0a221a["diffTestSchemasSqlite"]
  e03ff09a_ddea_4c40_090c_ef904fc5f3c5 --> 843d184b_68ea_28e0_a4e7_11ed8d0a221a
  690f7dfc_0aea_9ee8_d6e7_26bbb3689031["drizzle-orm"]
  e03ff09a_ddea_4c40_090c_ef904fc5f3c5 --> 690f7dfc_0aea_9ee8_d6e7_26bbb3689031
  25248a9d_ba06_2b33_4421_8575da2f9c34["sqlite-core"]
  e03ff09a_ddea_4c40_090c_ef904fc5f3c5 --> 25248a9d_ba06_2b33_4421_8575da2f9c34
  8d35eaf2_a542_cfd4_fa1a_fafca0f02686["vitest"]
  e03ff09a_ddea_4c40_090c_ef904fc5f3c5 --> 8d35eaf2_a542_cfd4_fa1a_fafca0f02686
  style e03ff09a_ddea_4c40_090c_ef904fc5f3c5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { sql } from 'drizzle-orm';
import {
	AnySQLiteColumn,
	foreignKey,
	index,
	int,
	primaryKey,
	sqliteTable,
	text,
	unique,
	uniqueIndex,
} from 'drizzle-orm/sqlite-core';
import { expect, test } from 'vitest';
import { diffTestSchemasSqlite } from './schemaDiffer';

test('add table #1', async () => {
	const to = {
		users: sqliteTable('users', {}),
	};

	const { statements } = await diffTestSchemasSqlite({}, to, []);

	expect(statements.length).toBe(1);
	expect(statements[0]).toStrictEqual({
		type: 'sqlite_create_table',
		tableName: 'users',
		columns: [],
		compositePKs: [],
		uniqueConstraints: [],
		referenceData: [],
		checkConstraints: [],
	});
});

test('add table #2', async () => {
	const to = {
		users: sqliteTable('users', {
			id: int('id').primaryKey({ autoIncrement: true }),
		}),
	};

	const { statements } = await diffTestSchemasSqlite({}, to, []);

	expect(statements.length).toBe(1);
	expect(statements[0]).toStrictEqual({
		type: 'sqlite_create_table',
		tableName: 'users',
		columns: [
			{
				name: 'id',
				notNull: true,
				primaryKey: true,
				type: 'integer',
				autoincrement: true,
			},
		],
		compositePKs: [],
		referenceData: [],
		uniqueConstraints: [],
		checkConstraints: [],
// ... (578 more lines)

Domain

Dependencies

Frequently Asked Questions

What does sqlite-tables.test.ts do?
sqlite-tables.test.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain.
What does sqlite-tables.test.ts depend on?
sqlite-tables.test.ts imports 5 module(s): diffTestSchemasSqlite, drizzle-orm, schemaDiffer.ts, sqlite-core, vitest.
Where is sqlite-tables.test.ts in the architecture?
sqlite-tables.test.ts is located at drizzle-kit/tests/sqlite-tables.test.ts (domain: DrizzleORM, directory: drizzle-kit/tests).

Analyze Your Own Codebase

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

Try Supermodel Free