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

normaliseSQLiteUrl() — drizzle-orm Function Reference

Architecture documentation for the normaliseSQLiteUrl() function in utils.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  a7e5f36c_3b28_1510_a488_f9186cbffe48["normaliseSQLiteUrl()"]
  5847e5ae_7b4a_4b02_b68f_883ef88b3c1a["utils.ts"]
  a7e5f36c_3b28_1510_a488_f9186cbffe48 -->|defined in| 5847e5ae_7b4a_4b02_b68f_883ef88b3c1a
  6ae846ed_e380_1862_4b08_adb2d7fa0275["connectToSQLite()"]
  6ae846ed_e380_1862_4b08_adb2d7fa0275 -->|calls| a7e5f36c_3b28_1510_a488_f9186cbffe48
  66435e24_fdd6_97b9_c062_1bb68ffdb73d["connectToLibSQL()"]
  66435e24_fdd6_97b9_c062_1bb68ffdb73d -->|calls| a7e5f36c_3b28_1510_a488_f9186cbffe48
  071bfc71_ad06_c0c4_cba2_360298dd4b47["assertUnreachable()"]
  a7e5f36c_3b28_1510_a488_f9186cbffe48 -->|calls| 071bfc71_ad06_c0c4_cba2_360298dd4b47
  style a7e5f36c_3b28_1510_a488_f9186cbffe48 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/utils.ts lines 310–338

export const normaliseSQLiteUrl = (
	it: string,
	type: 'libsql' | 'better-sqlite',
) => {
	if (type === 'libsql') {
		if (it.startsWith('file:')) {
			return it;
		}
		try {
			const url = parse(it);
			if (url.protocol === null) {
				return `file:${it}`;
			}
			return it;
		} catch (e) {
			return `file:${it}`;
		}
	}

	if (type === 'better-sqlite') {
		if (it.startsWith('file:')) {
			return it.substring(5);
		}

		return it;
	}

	assertUnreachable(type);
};

Domain

Subdomains

Frequently Asked Questions

What does normaliseSQLiteUrl() do?
normaliseSQLiteUrl() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/utils.ts.
Where is normaliseSQLiteUrl() defined?
normaliseSQLiteUrl() is defined in drizzle-kit/src/utils.ts at line 310.
What does normaliseSQLiteUrl() call?
normaliseSQLiteUrl() calls 1 function(s): assertUnreachable.
What calls normaliseSQLiteUrl()?
normaliseSQLiteUrl() is called by 2 function(s): connectToLibSQL, connectToSQLite.

Analyze Your Own Codebase

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

Try Supermodel Free