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

startStudioPostgresServer() — drizzle-orm Function Reference

Architecture documentation for the startStudioPostgresServer() function in api.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  3f2f3ef6_5edc_28b2_d8ba_6463008848f8["startStudioPostgresServer()"]
  e668bfef_9125_1ef0_2f94_a0f9605584bd["api.ts"]
  3f2f3ef6_5edc_28b2_d8ba_6463008848f8 -->|defined in| e668bfef_9125_1ef0_2f94_a0f9605584bd
  f115fdf8_009e_f0a5_2e08_c650dffd2496["drizzleForPostgres()"]
  3f2f3ef6_5edc_28b2_d8ba_6463008848f8 -->|calls| f115fdf8_009e_f0a5_2e08_c650dffd2496
  4989a948_cacf_e4b2_7283_c9335d2b7983["startServerFromSetup()"]
  3f2f3ef6_5edc_28b2_d8ba_6463008848f8 -->|calls| 4989a948_cacf_e4b2_7283_c9335d2b7983
  style 3f2f3ef6_5edc_28b2_d8ba_6463008848f8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/api.ts lines 190–221

export const startStudioPostgresServer = async (
	imports: Record<string, unknown>,
	credentials: PostgresCredentials | {
		driver: 'pglite';
		client: PGlite;
	},
	options?: {
		host?: string;
		port?: number;
		casing?: CasingType;
	},
) => {
	const { drizzleForPostgres } = await import('./serializer/studio');

	const pgSchema: Record<string, Record<string, AnyPgTable>> = {};
	const relations: Record<string, Relations> = {};

	Object.entries(imports).forEach(([k, t]) => {
		if (is(t, PgTable)) {
			const schema = pgTableConfig(t).schema || 'public';
			pgSchema[schema] = pgSchema[schema] || {};
			pgSchema[schema][k] = t;
		}

		if (is(t, Relations)) {
			relations[k] = t;
		}
	});

	const setup = await drizzleForPostgres(credentials, pgSchema, relations, [], options?.casing);
	await startServerFromSetup(setup, options);
};

Domain

Subdomains

Frequently Asked Questions

What does startStudioPostgresServer() do?
startStudioPostgresServer() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/api.ts.
Where is startStudioPostgresServer() defined?
startStudioPostgresServer() is defined in drizzle-kit/src/api.ts at line 190.
What does startStudioPostgresServer() call?
startStudioPostgresServer() calls 2 function(s): drizzleForPostgres, startServerFromSetup.

Analyze Your Own Codebase

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

Try Supermodel Free