Home / File/ mysqlTest.ts — drizzle-orm Source File

mysqlTest.ts — drizzle-orm Source File

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

Entity Profile

Dependency Diagram

graph LR
  acec895d_3abf_95cd_e7b3_cbd4027d025c["mysqlTest.ts"]
  eb1e881c_5047_858a_b1d7_0ebf5e119d52["mysqlSchema.ts"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> eb1e881c_5047_858a_b1d7_0ebf5e119d52
  0fabdd81_61c9_bb7c_7ddf_dde7a6071abc["index.ts"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> 0fabdd81_61c9_bb7c_7ddf_dde7a6071abc
  ee61d65c_3a91_eebf_195c_778a484baf2b["seed"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> ee61d65c_3a91_eebf_195c_778a484baf2b
  c440e00a_e318_94ac_100c_9843a182c7a4["config"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> c440e00a_e318_94ac_100c_9843a182c7a4
  412eac48_6e13_8b0f_b7b2_5c943c225130["path"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> 412eac48_6e13_8b0f_b7b2_5c943c225130
  da5f49c7_67eb_d6c6_2fa2_c3592f35dc62["mysql2"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> da5f49c7_67eb_d6c6_2fa2_c3592f35dc62
  eef8eb61_1e0a_b66c_7c58_4d85a1195ccf["migrator"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> eef8eb61_1e0a_b66c_7c58_4d85a1195ccf
  a340f455_7575_91f4_791a_10cd9b9dba1a["promise"]
  acec895d_3abf_95cd_e7b3_cbd4027d025c --> a340f455_7575_91f4_791a_10cd9b9dba1a
  style acec895d_3abf_95cd_e7b3_cbd4027d025c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import 'dotenv/config';
import path from 'path';

import { drizzle } from 'drizzle-orm/mysql2';
import { migrate } from 'drizzle-orm/mysql2/migrator';
import mysql from 'mysql2/promise';

import * as schema from './mysqlSchema.ts';

import { seed } from '../../src/index.ts';

const { Mysql_HOST, Mysql_PORT, Mysql_DATABASE, Mysql_USER, Mysql_PASSWORD } = process.env;

const mysqlPool = mysql.createPool({
	host: Mysql_HOST,
	port: Number(Mysql_PORT) || 3306,
	database: Mysql_DATABASE,
	user: Mysql_USER,
	password: Mysql_PASSWORD,
	// ssl: { rejectUnauthorized: false }
});

const db = drizzle(mysqlPool);

console.log('database connection was established successfully.');

(async () => {
	await migrate(db, { migrationsFolder: path.join(__dirname, '../../../mysqlMigrations') });
	console.log('database was migrated.');

	// await seed(db, schema, { count: 100000, seed: 1 });

	const titlesOfCourtesy = ['Ms.', 'Mrs.', 'Dr.'];
	const unitsOnOrders = [0, 10, 20, 30, 50, 60, 70, 80, 100];
	const reorderLevels = [0, 5, 10, 15, 20, 25, 30];
	const quantityPerUnit = [
		'100 - 100 g pieces',
		'100 - 250 g bags',
		'10 - 200 g glasses',
		'10 - 4 oz boxes',
		'10 - 500 g pkgs.',
		'10 - 500 g pkgs.',
		'10 boxes x 12 pieces',
		'10 boxes x 20 bags',
		'10 boxes x 8 pieces',
		'10 kg pkg.',
		'10 pkgs.',
		'12 - 100 g bars',
		'12 - 100 g pkgs',
		'12 - 12 oz cans',
		'12 - 1 lb pkgs.',
		'12 - 200 ml jars',
		'12 - 250 g pkgs.',
		'12 - 355 ml cans',
		'12 - 500 g pkgs.',
		'750 cc per bottle',
		'5 kg pkg.',
		'50 bags x 30 sausgs.',
		'500 ml',
		'500 g',
// ... (117 more lines)

Domain

Dependencies

Frequently Asked Questions

What does mysqlTest.ts do?
mysqlTest.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleSeed domain.
What does mysqlTest.ts depend on?
mysqlTest.ts imports 8 module(s): config, index.ts, migrator, mysql2, mysqlSchema.ts, path, promise, seed.
Where is mysqlTest.ts in the architecture?
mysqlTest.ts is located at drizzle-seed/tests/northwind/mysqlTest.ts (domain: DrizzleSeed, directory: drizzle-seed/tests/northwind).

Analyze Your Own Codebase

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

Try Supermodel Free