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

Function getVoteCount

cloud-sql/postgres/knex/index.js:205–207  ·  view source on GitHub ↗
(pool, candidate)

Source from the content-addressed store, hash-verified

203 * @returns {Promise}
204 */
205const getVoteCount = async (pool, candidate) => {
206 return await pool('votes').count('vote_id').where('candidate', candidate);
207};
208
209const httpGet = async (req, res) => {
210 pool = pool || (await createPoolAndEnsureSchema());

Callers 1

httpGetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected