MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / isValidDatabaseUrl

Function isValidDatabaseUrl

apps/webapp/app/utils/db.ts:1–18  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

1export function isValidDatabaseUrl(url: string) {
2 try {
3 const databaseUrl = new URL(url);
4 const schemaFromSearchParam = databaseUrl.searchParams.get("schema");
5
6 if (schemaFromSearchParam === "") {
7 console.error(
8 "Invalid Database URL: The schema search param can't have an empty value. To use the `public` schema, either omit the schema param entirely or specify it in full: `?schema=public`"
9 );
10 return false;
11 }
12
13 return true;
14 } catch (err) {
15 console.error(err);
16 return false;
17 }
18}

Callers 1

getDatabaseSchemaFunction · 0.90

Calls 2

errorMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…