made with esnextbin
Last active
June 26, 2016 01:58
-
-
Save timwis/0041047c31c4cc4d5106c45932958dd7 to your computer and use it in GitHub Desktop.
esnextbin sketch
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<!-- put markup and other contents here --> | |
</body> | |
</html> |
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 knex = require('knex/build/knex')({client: 'pg'}) | |
const sql = 'alter column foo type :type (:maxLength)' | |
const bindings = { | |
type: 'character varying', | |
maxLength: 24 | |
} | |
const result = knex.raw(sql, bindings).toString() | |
console.log(result) |
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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"knex": "0.11.7" | |
} | |
} |
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
'use strict'; | |
var knex = require('knex/build/knex')({ client: 'pg' }); | |
var sql = 'alter column foo type :type (:maxLength)'; | |
var bindings = { | |
type: 'character varying', | |
maxLength: 24 | |
}; | |
var result = knex.raw(sql, bindings).toString(); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment