Home / Function/ upPgHandler() — drizzle-orm Function Reference

upPgHandler() — drizzle-orm Function Reference

Architecture documentation for the upPgHandler() function in pgUp.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  b88883be_9aee_d2b0_1c78_5ac04683bbbf["upPgHandler()"]
  466af62c_27ae_41b6_d841_1dc8334565a4["pgUp.ts"]
  b88883be_9aee_d2b0_1c78_5ac04683bbbf -->|defined in| 466af62c_27ae_41b6_d841_1dc8334565a4
  4a6e097c_99b9_068e_9f2a_61b0ea3326d0["up.handler()"]
  4a6e097c_99b9_068e_9f2a_61b0ea3326d0 -->|calls| b88883be_9aee_d2b0_1c78_5ac04683bbbf
  3f325b6b_14df_fa20_c5d7_83c98bc3d75c["prepareOutFolder()"]
  b88883be_9aee_d2b0_1c78_5ac04683bbbf -->|calls| 3f325b6b_14df_fa20_c5d7_83c98bc3d75c
  b18145b4_f05d_a9ae_4a8e_98368ec2cf0d["validateWithReport()"]
  b88883be_9aee_d2b0_1c78_5ac04683bbbf -->|calls| b18145b4_f05d_a9ae_4a8e_98368ec2cf0d
  db63d11a_f28c_6301_37b3_f7c59b7ccf7f["updateUpToV6()"]
  b88883be_9aee_d2b0_1c78_5ac04683bbbf -->|calls| db63d11a_f28c_6301_37b3_f7c59b7ccf7f
  81a1619d_035b_4c36_5042_7d366fbacfc5["updateUpToV7()"]
  b88883be_9aee_d2b0_1c78_5ac04683bbbf -->|calls| 81a1619d_035b_4c36_5042_7d366fbacfc5
  style b88883be_9aee_d2b0_1c78_5ac04683bbbf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/cli/commands/pgUp.ts lines 17–42

export const upPgHandler = (out: string) => {
	const { snapshots } = prepareOutFolder(out, 'postgresql');
	const report = validateWithReport(snapshots, 'postgresql');

	report.nonLatest
		.map((it) => ({
			path: it,
			raw: report.rawMap[it]!! as Record<string, any>,
		}))
		.forEach((it) => {
			const path = it.path;

			let resultV6 = it.raw;
			if (it.raw.version === '5') {
				resultV6 = updateUpToV6(it.raw);
			}

			const result = updateUpToV7(resultV6);

			console.log(`[${chalk.green('✓')}] ${path}`);

			writeFileSync(path, JSON.stringify(result, null, 2));
		});

	console.log("Everything's fine 🐶🔥");
};

Domain

Subdomains

Called By

Frequently Asked Questions

What does upPgHandler() do?
upPgHandler() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/commands/pgUp.ts.
Where is upPgHandler() defined?
upPgHandler() is defined in drizzle-kit/src/cli/commands/pgUp.ts at line 17.
What does upPgHandler() call?
upPgHandler() calls 4 function(s): prepareOutFolder, updateUpToV6, updateUpToV7, validateWithReport.
What calls upPgHandler()?
upPgHandler() is called by 1 function(s): up.handler.

Analyze Your Own Codebase

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

Try Supermodel Free