MCPcopy Index your code
hub / github.com/BuilderIO/agent-native / databaseLabel

Function databaseLabel

packages/core/src/scripts/db/schema.ts:42–51  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

40}
41
42function databaseLabel(url: string): string {
43 if (url.startsWith("file:")) return url.slice(5);
44 try {
45 const parsed = new URL(url);
46 const auth = parsed.username ? `${parsed.username}:***@` : "";
47 return `${parsed.protocol}//${auth}${parsed.host}${parsed.pathname}`;
48 } catch {
49 return url.replace(/:\/\/([^:@\s]+):([^@\s]+)@/, "://$1:***@");
50 }
51}
52
53/**
54 * Execute a PRAGMA query and return the rows as plain objects.

Callers 2

introspectPostgresFunction · 0.85
dbSchemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected