How to use the promise-mysql.format function in promise-mysql

To help you get started, we’ve selected a few promise-mysql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LeadcoinNetwork / Web-App-Project / backend / models / mysql-pool / mysql-pool.ts View on Github external
public async query(...args): Promise {
    var query = mysql.format(...args)
    try {
      var result = await this.pool.query(query)
    } catch (err) {
      this.log("query", { error: err.message, query })
      throw err
    }
    this.log("query", { query, result })
    return result
  }
  private async checkdb() {
github Bjorn248 / graphql_aws_pricing_api / server / src / server.ts View on Github external
const queryIdentifiers = [];
  queryIdentifiers.push(tableName);
  if (Object.keys(args).length !== 0) {
    queryString += ' WHERE ';
    Object.keys(args).forEach(function(arg, index) {
      if (index > 0) {
        queryString += ' AND ';
      }
      queryString += '?? = ?';
      queryIdentifiers.push(arg);
      queryIdentifiers.push(args[arg]);
    });
  }

  queryIdentifiers.unshift(selectionColumns);
  queryString = format(queryString, queryIdentifiers);
  return pool.query(queryString);
};
export const generateFieldFunction = FieldMap => () => FieldMap;

promise-mysql

A bluebird wrapper for node-mysql

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis