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

convert() — drizzle-orm Function Reference

Architecture documentation for the convert() function in sqlgenerator.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  ff0e1bf0_5ad3_8163_520a_b6eeca6b5100["convert()"]
  f5757cac_709f_0373_7ee3_b4b2510a2e2c["PgAlterViewAddWithOptionConvertor"]
  ff0e1bf0_5ad3_8163_520a_b6eeca6b5100 -->|defined in| f5757cac_709f_0373_7ee3_b4b2510a2e2c
  style ff0e1bf0_5ad3_8163_520a_b6eeca6b5100 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/sqlgenerator.ts lines 932–948

	convert(st: JsonAlterViewAddWithOptionStatement) {
		const { schema, with: withOption, name, materialized } = st;

		let statement = `ALTER${materialized ? ' MATERIALIZED' : ''} VIEW "${schema}"."${name}" SET (`;

		const options: string[] = [];

		Object.entries(withOption).forEach(([key, value]) => {
			options.push(`${key.snake_case()} = ${value}`);
		});

		statement += options.join(', ');

		statement += `);`;

		return statement;
	}

Domain

Subdomains

Frequently Asked Questions

What does convert() do?
convert() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/sqlgenerator.ts.
Where is convert() defined?
convert() is defined in drizzle-kit/src/sqlgenerator.ts at line 932.

Analyze Your Own Codebase

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

Try Supermodel Free