Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"message":"Error validating selections: s.sql is not a function","level":"error"}
- const mysqlx = require('@mysql/xdevapi')
- const logger = require('./logger')
- const {
- MYSQL_USER,
- MYSQL_PASSWORD,
- MYSQL_HOST,
- MYSQL_PORT,
- MYSQL_SCHEMA
- } = process.env
- const session = mysqlx.getSession({
- user: MYSQL_USER,
- password: MYSQL_PASSWORD,
- host: MYSQL_HOST,
- port: parseInt(MYSQL_PORT)
- })
- .catch(e => logger.error('Error connecting to database:', e))
- exports.validateSelections = selections =>
- session
- .then(s => s
- .getSchema(MYSQL_SCHEMA)
- .sql('SELECT * FROM affiliate_links WHERE id = 1')
- .execute()
- )
Add Comment
Please, Sign In to add comment