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

index.ts — drizzle-orm Source File

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

File typescript DrizzleKit SchemaDiffer 5 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  3337fb45_cdc6_b02c_a270_5043f829b54b["index.ts"]
  5bf76609_579e_d312_b33b_ab5b8b683111["schema.ts"]
  3337fb45_cdc6_b02c_a270_5043f829b54b --> 5bf76609_579e_d312_b33b_ab5b8b683111
  34140e39_ad92_a121_09b2_e3e2624fd021["utils.ts"]
  3337fb45_cdc6_b02c_a270_5043f829b54b --> 34140e39_ad92_a121_09b2_e3e2624fd021
  0762c41b_fa7e_14b7_efe4_4e1d741472cb["ormCoreVersions"]
  3337fb45_cdc6_b02c_a270_5043f829b54b --> 0762c41b_fa7e_14b7_efe4_4e1d741472cb
  1c7f9ac7_5c40_4d3d_8edf_fcb550a29ebe["brocli"]
  3337fb45_cdc6_b02c_a270_5043f829b54b --> 1c7f9ac7_5c40_4d3d_8edf_fcb550a29ebe
  0f00c7dd_5eba_f1f8_c559_a99431086500["chalk"]
  3337fb45_cdc6_b02c_a270_5043f829b54b --> 0f00c7dd_5eba_f1f8_c559_a99431086500
  style 3337fb45_cdc6_b02c_a270_5043f829b54b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { command, run } from '@drizzle-team/brocli';
import chalk from 'chalk';
import { check, drop, exportRaw, generate, migrate, pull, push, studio, up } from './schema';
import { ormCoreVersions } from './utils';

const version = async () => {
	const { npmVersion } = await ormCoreVersions();
	const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : '';
	const envVersion = process.env.DRIZZLE_KIT_VERSION;
	const kitVersion = envVersion ? `v${envVersion}` : '--';
	const versions = `drizzle-kit: ${kitVersion}\n${ormVersion}`;
	console.log(chalk.gray(versions), '\n');
};

const legacyCommand = (name: string, newName: string) => {
	return command({
		name,
		hidden: true,
		handler: () => {
			console.log(
				`This command is deprecated, please use updated '${newName}' command (see https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210)`,
			);
		},
	});
};

const legacy = [
	legacyCommand('generate:pg', 'generate'),
	legacyCommand('generate:mysql', 'generate'),
	legacyCommand('generate:sqlite', 'generate'),
	legacyCommand('push:pg', 'push'),
	legacyCommand('push:mysql', 'push'),
	legacyCommand('push:sqlite', 'push'),
	legacyCommand('introspect:pg', 'introspect'),
	legacyCommand('introspect:mysql', 'introspect'),
	legacyCommand('introspect:sqlite', 'introspect'),
	legacyCommand('up:pg', 'up'),
	legacyCommand('up:mysql', 'up'),
	legacyCommand('up:sqlite', 'up'),
	legacyCommand('check:pg', 'check'),
	legacyCommand('check:mysql', 'check'),
	legacyCommand('check:sqlite', 'check'),
];

run([generate, migrate, pull, push, studio, up, check, drop, exportRaw, ...legacy], {
	name: 'drizzle-kit',
	version: version,
});

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does index.ts do?
index.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleKit domain, SchemaDiffer subdomain.
What functions are defined in index.ts?
index.ts defines 2 function(s): legacyCommand, version.
What does index.ts depend on?
index.ts imports 5 module(s): brocli, chalk, ormCoreVersions, schema.ts, utils.ts.
Where is index.ts in the architecture?
index.ts is located at drizzle-kit/src/cli/index.ts (domain: DrizzleKit, subdomain: SchemaDiffer, directory: drizzle-kit/src/cli).

Analyze Your Own Codebase

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

Try Supermodel Free