Created
January 18, 2018 13:45
-
-
Save neonerd/ae4844ac980317264974ca9ec3eee29e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 mssql = require("mssql") | |
const puresql = require("puresql") | |
// Load our queries | |
const queries = puresql.loadQueries("user.sql") | |
// Create a connection the adapter will use | |
mssql.connect('mssql://user:password@host/database') | |
.then(() => { | |
// Create the adapter | |
const adapter = puresql.adapters.mssql(mssql) | |
// Do something | |
async function foo() { | |
const rows = await queries.get({}, adapter) | |
rows.map(row => { | |
console.log('UserId: ' + row.UserId) | |
}) | |
} | |
foo() | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment