| 122 | * @returns {Promise} |
| 123 | */ |
| 124 | const 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 |