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

outputs.ts — drizzle-orm Source File

Architecture documentation for outputs.ts, a typescript file in the drizzle-orm codebase. 2 imports, 15 dependents.

File typescript DrizzleKit CLIWorkflow 2 imports 15 dependents 6 functions

Entity Profile

Dependency Diagram

graph LR
  502fb53b_89d2_ec40_3a24_f05850833f68["outputs.ts"]
  9135e6b6_37f7_c980_ee35_90f5531de5a4["common.ts"]
  502fb53b_89d2_ec40_3a24_f05850833f68 --> 9135e6b6_37f7_c980_ee35_90f5531de5a4
  0f00c7dd_5eba_f1f8_c559_a99431086500["chalk"]
  502fb53b_89d2_ec40_3a24_f05850833f68 --> 0f00c7dd_5eba_f1f8_c559_a99431086500
  b14d3855_8cce_38c9_8952_a9d014c2fb1b["migrate.ts"]
  b14d3855_8cce_38c9_8952_a9d014c2fb1b --> 502fb53b_89d2_ec40_3a24_f05850833f68
  b387f7cb_f080_cc3a_a94d_1e2775ef2400["mysqlPushUtils.ts"]
  b387f7cb_f080_cc3a_a94d_1e2775ef2400 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  6219550e_1686_ca7a_0d96_0838fb90e7cb["push.ts"]
  6219550e_1686_ca7a_0d96_0838fb90e7cb --> 502fb53b_89d2_ec40_3a24_f05850833f68
  65107a57_7714_63e5_7018_8c2efc0f3b41["singlestorePushUtils.ts"]
  65107a57_7714_63e5_7018_8c2efc0f3b41 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  09e5bcf1_0f03_3dbd_fbdb_762440f28855["utils.ts"]
  09e5bcf1_0f03_3dbd_fbdb_762440f28855 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  4e02c2bb_54a8_1500_813e_2cafd1ad4f59["connections.ts"]
  4e02c2bb_54a8_1500_813e_2cafd1ad4f59 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  5bf76609_579e_d312_b33b_ab5b8b683111["schema.ts"]
  5bf76609_579e_d312_b33b_ab5b8b683111 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  9135e6b6_37f7_c980_ee35_90f5531de5a4["common.ts"]
  9135e6b6_37f7_c980_ee35_90f5531de5a4 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  d81f4f07_7d2c_ea3f_392e_6be6055ba361["mysql.ts"]
  d81f4f07_7d2c_ea3f_392e_6be6055ba361 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  f65d82f8_85a1_d127_5f91_94b02851c72a["singlestore.ts"]
  f65d82f8_85a1_d127_5f91_94b02851c72a --> 502fb53b_89d2_ec40_3a24_f05850833f68
  33990744_4141_72e3_2ae9_3c695bf71d75["gelSerializer.ts"]
  33990744_4141_72e3_2ae9_3c695bf71d75 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  1f633f0f_d981_8483_0b8f_fbabf0333ced["mysqlSerializer.ts"]
  1f633f0f_d981_8483_0b8f_fbabf0333ced --> 502fb53b_89d2_ec40_3a24_f05850833f68
  df5ff696_3bb2_dd84_a601_810793c9ec74["pgSerializer.ts"]
  df5ff696_3bb2_dd84_a601_810793c9ec74 --> 502fb53b_89d2_ec40_3a24_f05850833f68
  style 502fb53b_89d2_ec40_3a24_f05850833f68 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import chalk from 'chalk';
import { sqliteDriversLiterals } from './common';

export const withStyle = {
	error: (str: string) => `${chalk.red(`${chalk.white.bgRed(' Invalid input ')} ${str}`)}`,
	warning: (str: string) => `${chalk.white.bgGray(' Warning ')} ${str}`,
	errorWarning: (str: string) => `${chalk.red(`${chalk.white.bgRed(' Warning ')} ${str}`)}`,
	fullWarning: (str: string) => `${chalk.black.bgYellow(' Warning ')} ${chalk.bold(str)}`,
	suggestion: (str: string) => `${chalk.white.bgGray(' Suggestion ')} ${str}`,
	info: (str: string) => `${chalk.grey(str)}`,
};

export const outputs = {
	studio: {
		drivers: (param: string) =>
			withStyle.error(
				`"${param}" is not a valid driver. Available drivers: "pg", "mysql2", "better-sqlite", "libsql", "turso". You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`,
			),
		noCredentials: () =>
			withStyle.error(
				`Please specify a 'dbCredentials' param in config. It will help drizzle to know how to query you database. You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`,
			),
		noDriver: () =>
			withStyle.error(
				`Please specify a 'driver' param in config. It will help drizzle to know how to query you database. You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`,
			),
		noDialect: () =>
			withStyle.error(
				`Please specify 'dialect' param in config, either of 'postgresql', 'mysql', 'sqlite', turso or singlestore`,
			),
	},
	common: {
		ambiguousParams: (command: string) =>
			withStyle.error(
				`You can't use both --config and other cli options for ${command} command`,
			),
		schema: (command: string) => withStyle.error(`"--schema" is a required field for ${command} command`),
	},
	postgres: {
		connection: {
			required: () =>
				withStyle.error(
					`Either "url" or "host", "database" are required for database connection`,
				),
			awsDataApi: () =>
				withStyle.error(
					"You need to provide 'database', 'secretArn' and 'resourceArn' for Drizzle Kit to connect to AWS Data API",
				),
		},
	},
	mysql: {
		connection: {
			driver: () => withStyle.error(`Only "mysql2" is available options for "--driver"`),
			required: () =>
				withStyle.error(
					`Either "url" or "host", "database" are required for database connection`,
				),
		},
	},
	sqlite: {
		connection: {
			driver: () => {
				const listOfDrivers = sqliteDriversLiterals
					.map((it) => `'${it.value}'`)
					.join(', ');
				return withStyle.error(
					`Either ${listOfDrivers} are available options for 'driver' param`,
				);
			},
			url: (driver: string) =>
				withStyle.error(
					`"url" is a required option for driver "${driver}". You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`,
				),
			authToken: (driver: string) =>
				withStyle.error(
					`"authToken" is a required option for driver "${driver}". You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`,
				),
		},
		introspect: {},
		push: {},
	},
	singlestore: {
		connection: {
			driver: () => withStyle.error(`Only "mysql2" is available options for "--driver"`),
			required: () =>
				withStyle.error(
					`Either "url" or "host", "database" are required for database connection`,
				),
		},
	},
};

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does outputs.ts do?
outputs.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleKit domain, CLIWorkflow subdomain.
What functions are defined in outputs.ts?
outputs.ts defines 6 function(s): withStyle.error, withStyle.errorWarning, withStyle.fullWarning, withStyle.info, withStyle.suggestion, withStyle.warning.
What does outputs.ts depend on?
outputs.ts imports 2 module(s): chalk, common.ts.
What files import outputs.ts?
outputs.ts is imported by 15 file(s): common.ts, connections.ts, gelSerializer.ts, migrate.ts, mysql.ts, mysqlPushUtils.ts, mysqlSerializer.ts, pgSerializer.ts, and 7 more.
Where is outputs.ts in the architecture?
outputs.ts is located at drizzle-kit/src/cli/validations/outputs.ts (domain: DrizzleKit, subdomain: CLIWorkflow, directory: drizzle-kit/src/cli/validations).

Analyze Your Own Codebase

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

Try Supermodel Free