Last active
July 18, 2018 19:23
-
-
Save gabidavila/d6b98b227166f093cb88d5b54555f499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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