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

Function getVoteCount

run/idp-sql/cloud-sql.js:124–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 * @returns {Promise}
123 */
124const getVoteCount = async candidate => {
125 if (!knex) knex = await connect();
126 return knex(TABLE).count('vote_id').where('candidate', candidate);
127};
128
129/**
130 * Create "votes" table in the Cloud SQL database

Callers 1

app.jsFile · 0.70

Calls 1

connectFunction · 0.70

Tested by

no test coverage detected