How to use the mysql2/promise.raw function in mysql2

To help you get started, we’ve selected a few mysql2 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 connect-foundation / 2019-06 / infra / maildb / src / format.js View on Github external
const QUERY = {
  INSERT: "INSERT INTO ?? SET ?",
  SELECT: "SELECT ?? AS ?, ?? FROM ?? WHERE ?? = ?? AND ?? = ? AND ?? = ?"
};

const IDENTIFIER = {
  USER_NO: `${TABLE.USER}.no`,
  CATEGORY_NO: `${TABLE.CATEGORY}.no`,
  CATEGORY_USER_NO: `${TABLE.CATEGORY}.user_no`,
  CATEGOTY_NAME: `${TABLE.CATEGORY}.name`,
  ID: "id"
};

const VALUE = {
  OWNER: "owner",
  NOW: mysql.raw("now()"),
  MAILBOX: "받은메일함",
  SENT_MAILBOX: "보낸메일함"
};

const getQueryToAddMailTemplate = ({
  from,
  to,
  subject,
  text,
  html,
  attachments
}) => {
  const valueOfMailTemplate = {
    from,
    to,
    subject,