Home / Function/ executeSeedFile() — astro Function Reference

executeSeedFile() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  cdc2ee10_0683_2ffd_ac03_f35f104cde5b["executeSeedFile()"]
  74eaede6_604c_f153_5a03_fab5555699d5["index.ts"]
  cdc2ee10_0683_2ffd_ac03_f35f104cde5b -->|defined in| 74eaede6_604c_f153_5a03_fab5555699d5
  bae2f194_ed09_ed10_da43_ef94962b8ab8["astroDBIntegration()"]
  bae2f194_ed09_ed10_da43_ef94962b8ab8 -->|calls| cdc2ee10_0683_2ffd_ac03_f35f104cde5b
  style cdc2ee10_0683_2ffd_ac03_f35f104cde5b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/db/src/core/integration/index.ts lines 220–242

async function executeSeedFile({
	fileUrl,
	environment,
}: {
	fileUrl: URL;
	environment: RunnableDevEnvironment;
}) {
	// Use decodeURIComponent to handle paths with spaces correctly
	// This ensures that %20 in the pathname is properly handled
	const pathname = decodeURIComponent(fileUrl.pathname);
	const mod = await environment.runner.import(pathname);
	if (typeof mod.default !== 'function') {
		throw new AstroDbError(EXEC_DEFAULT_EXPORT_ERROR(fileURLToPath(fileUrl)));
	}
	try {
		await mod.default();
	} catch (e) {
		if (isDbError(e)) {
			throw new AstroDbError(EXEC_ERROR(e.message));
		}
		throw e;
	}
}

Domain

Subdomains

Frequently Asked Questions

What does executeSeedFile() do?
executeSeedFile() is a function in the astro codebase, defined in packages/db/src/core/integration/index.ts.
Where is executeSeedFile() defined?
executeSeedFile() is defined in packages/db/src/core/integration/index.ts at line 220.
What calls executeSeedFile()?
executeSeedFile() is called by 1 function(s): astroDBIntegration.

Analyze Your Own Codebase

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

Try Supermodel Free