MCPcopy Index your code
hub / github.com/linuxfoundation/crowd.dev / getCredentials

Function getCredentials

backend/src/database/models/index.ts:19–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19function getCredentials(): Credentials {
20 if (DB_CONFIG.username) {
21 return {
22 username: DB_CONFIG.username,
23 password: DB_CONFIG.password,
24 }
25 }
26
27 switch (SERVICE) {
28 case configTypes.ServiceType.API:
29 return {
30 username: DB_CONFIG.apiUsername,
31 password: DB_CONFIG.apiPassword,
32 }
33 case configTypes.ServiceType.JOB_GENERATOR:
34 return {
35 username: DB_CONFIG.jobGeneratorUsername,
36 password: DB_CONFIG.jobGeneratorPassword,
37 }
38 case configTypes.ServiceType.NODEJS_WORKER:
39 return {
40 username: DB_CONFIG.nodejsWorkerUsername,
41 password: DB_CONFIG.nodejsWorkerPassword,
42 }
43 default:
44 throw new Error('Incorrectly configured database connection settings!')
45 }
46}
47
48function models(queryTimeoutMilliseconds: number) {
49 const database = {} as any

Callers 1

modelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected