const mysqlx = require('@mysql/xdevapi'); | |
const options = require('./config') | |
mysqlx.getSession(options) | |
.then((session) => { | |
const db = session.getSchema("worldcup"); | |
const tableTeams = db.getTable("teams"); | |
return tableTeams; | |
}) | |
.then((t) => { | |
t.select(['id', 'name', 'players']) | |
.where('name = :name') | |
.bind('name', 'Brazil') | |
.limit(1) | |
.execute(console.log); | |
}) | |
.catch(err => { | |
console.log(err.stack); | |
process.exit(1); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment