MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / connect

Function connect

run/idp-sql/cloud-sql.js:83–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81 * @returns {object} Knex's PostgreSQL client
82 */
83const connect = async () => {
84 if (!credConfig) credConfig = getCredConfig();
85 if (process.env.DB_HOST) {
86 return connectWithTcp(credConfig);
87 } else {
88 return connectWithUnixSockets(credConfig);
89 }
90};
91
92/**
93 * Insert a vote record into the database.

Callers 4

insertVoteFunction · 0.70
getVotesFunction · 0.70
getVoteCountFunction · 0.70
createTableFunction · 0.70

Calls 3

getCredConfigFunction · 0.85
connectWithTcpFunction · 0.85
connectWithUnixSocketsFunction · 0.85

Tested by

no test coverage detected