MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / getTestDbUrl

Function getTestDbUrl

packages/cli/test/utils.ts:45–56  ·  view source on GitHub ↗
(provider: 'sqlite' | 'postgresql' | 'mysql', dbName: string)

Source from the content-addressed store, hash-verified

43}
44
45export function getTestDbUrl(provider: 'sqlite' | 'postgresql' | 'mysql', dbName: string): string {
46 switch (provider) {
47 case 'sqlite':
48 return `file:${dbName}`;
49 case 'postgresql':
50 return `postgres://${TEST_PG_CONFIG.user}:${TEST_PG_CONFIG.password}@${TEST_PG_CONFIG.host}:${TEST_PG_CONFIG.port}/${dbName}`;
51 case 'mysql':
52 return `mysql://${TEST_MYSQL_CONFIG.user}:${TEST_MYSQL_CONFIG.password}@${TEST_MYSQL_CONFIG.host}:${TEST_MYSQL_CONFIG.port}/${dbName}`;
53 default:
54 throw new Error(`Unsupported provider: ${provider}`);
55 }
56}
57
58export function getDefaultPrelude(options?: {
59 provider?: 'sqlite' | 'postgresql' | 'mysql';

Callers 1

pull.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected