Home / Function/ normalizeDatabaseUrl() — astro Function Reference

normalizeDatabaseUrl() — astro Function Reference

Architecture documentation for the normalizeDatabaseUrl() function in index.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  35342023_118e_4f44_6ded_dad9601e2674["normalizeDatabaseUrl()"]
  80ef4dc8_c183_c77f_e09f_d40d9a6ca694["index.ts"]
  35342023_118e_4f44_6ded_dad9601e2674 -->|defined in| 80ef4dc8_c183_c77f_e09f_d40d9a6ca694
  style 35342023_118e_4f44_6ded_dad9601e2674 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/db/src/runtime/index.ts lines 140–153

export function normalizeDatabaseUrl(envDbUrl: string | undefined, defaultDbUrl: string): string {
	if (envDbUrl) {
		// This could be a file URL, or more likely a root-relative file path.
		// Convert it to a file URL.
		if (envDbUrl.startsWith('file://')) {
			return envDbUrl;
		}

		return new URL(envDbUrl, pathToFileURL(process.cwd()) + '/').toString();
	} else {
		// This is going to be a file URL always,
		return defaultDbUrl;
	}
}

Domain

Subdomains

Frequently Asked Questions

What does normalizeDatabaseUrl() do?
normalizeDatabaseUrl() is a function in the astro codebase, defined in packages/db/src/runtime/index.ts.
Where is normalizeDatabaseUrl() defined?
normalizeDatabaseUrl() is defined in packages/db/src/runtime/index.ts at line 140.

Analyze Your Own Codebase

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

Try Supermodel Free