Skip to content

Instantly share code, notes, and snippets.

@timwis
Last active June 26, 2016 01:58
Show Gist options
  • Save timwis/0041047c31c4cc4d5106c45932958dd7 to your computer and use it in GitHub Desktop.
Save timwis/0041047c31c4cc4d5106c45932958dd7 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!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>
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)
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"knex": "0.11.7"
}
}
'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