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

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

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

File typescript 5 imports

Entity Profile

Dependency Diagram

graph LR
  90fa9393_7ca7_5d21_095e_db17d29282ee["sqlite-nw.test.ts"]
  8925695b_3773_48b7_06d1_2b60c9ed1057["bun:sqlite"]
  90fa9393_7ca7_5d21_095e_db17d29282ee --> 8925695b_3773_48b7_06d1_2b60c9ed1057
  690f7dfc_0aea_9ee8_d6e7_26bbb3689031["drizzle-orm"]
  90fa9393_7ca7_5d21_095e_db17d29282ee --> 690f7dfc_0aea_9ee8_d6e7_26bbb3689031
  0f536c46_cb7e_9bc4_fdab_a06ec204d431["bun-sqlite"]
  90fa9393_7ca7_5d21_095e_db17d29282ee --> 0f536c46_cb7e_9bc4_fdab_a06ec204d431
  25248a9d_ba06_2b33_4421_8575da2f9c34["sqlite-core"]
  90fa9393_7ca7_5d21_095e_db17d29282ee --> 25248a9d_ba06_2b33_4421_8575da2f9c34
  95653e07_60c5_db77_dba6_756bda105305["uvu"]
  90fa9393_7ca7_5d21_095e_db17d29282ee --> 95653e07_60c5_db77_dba6_756bda105305
  style 90fa9393_7ca7_5d21_095e_db17d29282ee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/// <reference types="bun-types" />
import { Database } from 'bun:sqlite';
import { DefaultLogger, sql } from 'drizzle-orm';
import type { BunSQLiteDatabase } from 'drizzle-orm/bun-sqlite';
import { drizzle } from 'drizzle-orm/bun-sqlite';
import { integer, real, sqliteTable, text } from 'drizzle-orm/sqlite-core';
import { suite } from 'uvu';

const order = sqliteTable('Order', {
	id: integer('Id'),
	customerId: text('CustomerId'),
	employeeId: integer('EmployeeId'),
	orderDate: text('OrderDate'),
	requiredDate: text('RequiredDate'),
	shippedDate: text('ShippedDate'),
	shipVia: integer('ShipVia'),
	freight: real('Freight'),
	shipName: text('ShipName'),
	shipAddress: text('ShipAddress'),
	shipCity: text('ShipCity'),
	shipRegion: text('ShipRegion'),
	shipPostalCode: text('ShipPostalCode'),
	shipCountry: text('ShipCountry'),
});

interface Context {
	db: BunSQLiteDatabase;
}

const test = suite<Context>('sqlite-bun');

test.before((ctx) => {
	try {
		const dbPath = process.env['SQLITE_DB_PATH'] ?? ':memory:';

		const client = new Database(dbPath);
		ctx.db = drizzle(client, { logger: new DefaultLogger() });
	} catch (e) {
		console.error(e);
	}
});

// test.before.each((ctx) => {
// 	try {
// 		const { db } = ctx;

// 		db.run(sql`drop table if exists ${usersTable}`);
// 		db.run(sql`
// 		create table ${usersTable} (
// 			id integer primary key,
// 			name text not null,
// 			verified integer not null default 0,
// 			json blob,
// 			created_at text not null default (strftime('%s', 'now'))
// 		)`);
// 	} catch (e) {
// 		console.error(e);
// 	}
// });

// ... (222 more lines)

Types

Dependencies

  • bun-sqlite
  • bun:sqlite
  • drizzle-orm
  • sqlite-core
  • uvu

Frequently Asked Questions

What does sqlite-nw.test.ts do?
sqlite-nw.test.ts is a source file in the drizzle-orm codebase, written in typescript.
What does sqlite-nw.test.ts depend on?
sqlite-nw.test.ts imports 5 module(s): bun-sqlite, bun:sqlite, drizzle-orm, sqlite-core, uvu.
Where is sqlite-nw.test.ts in the architecture?
sqlite-nw.test.ts is located at integration-tests/tests/bun/sqlite-nw.test.ts (directory: integration-tests/tests/bun).

Analyze Your Own Codebase

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

Try Supermodel Free