MCPcopy
hub / github.com/BuilderIO/agent-native / getDatabaseAuthToken

Function getDatabaseAuthToken

packages/core/src/db/client.ts:49–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48/** Same per-app resolution for DATABASE_AUTH_TOKEN (used by Turso/libsql). */
49export function getDatabaseAuthToken(): string | undefined {
50 const appName = process.env.APP_NAME?.toUpperCase().replace(/-/g, "_");
51 if (appName) {
52 const prefixed = process.env[`${appName}_DATABASE_AUTH_TOKEN`];
53 if (prefixed) return prefixed;
54 }
55 return process.env.DATABASE_AUTH_TOKEN;
56}
57
58// ---------------------------------------------------------------------------
59// Safe JSON column parsing

Callers 11

dbCheckScopingFunction · 0.85
fetchLegacyRowsFunction · 0.85
deleteLegacyRowFunction · 0.85
runSqliteFunction · 0.85
dbExecFunction · 0.85
dbQueryFunction · 0.85
dbSchemaFunction · 0.85
dbWipeLeakedBuilderKeysFunction · 0.85
buildDatabaseConfigFunction · 0.85
initClientFunction · 0.85
startInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected