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

objToStatement2() — drizzle-orm Function Reference

Architecture documentation for the objToStatement2() function in introspect-pg.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  17aaf236_8366_89c4_db23_4925d3c2eaf8["objToStatement2()"]
  71516551_23e3_bf30_27c9_000fb046ef71["introspect-pg.ts"]
  17aaf236_8366_89c4_db23_4925d3c2eaf8 -->|defined in| 71516551_23e3_bf30_27c9_000fb046ef71
  d060c9b2_d1df_37e7_df71_422307a42ed6["createTableColumns()"]
  d060c9b2_d1df_37e7_df71_422307a42ed6 -->|calls| 17aaf236_8366_89c4_db23_4925d3c2eaf8
  style 17aaf236_8366_89c4_db23_4925d3c2eaf8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/introspect-pg.ts lines 64–74

const objToStatement2 = (json: { [s: string]: unknown }) => {
	json = Object.fromEntries(Object.entries(json).filter((it) => it[1]));

	const keys = Object.keys(json);
	if (keys.length === 0) return;

	let statement = '{ ';
	statement += keys.map((it) => `${it}: "${json[it]}"`).join(', '); // no "" for keys
	statement += ' }';
	return statement;
};

Domain

Subdomains

Frequently Asked Questions

What does objToStatement2() do?
objToStatement2() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/introspect-pg.ts.
Where is objToStatement2() defined?
objToStatement2() is defined in drizzle-kit/src/introspect-pg.ts at line 64.
What calls objToStatement2()?
objToStatement2() is called by 1 function(s): createTableColumns.

Analyze Your Own Codebase

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

Try Supermodel Free