Use strict

This commit is contained in:
Daniel García Aubert 2018-10-24 18:52:57 +02:00
parent d7e5c1383f
commit 8b355b6e72
6 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,5 @@
'use strict';
module.exports = function(txt, options) {
return new CopyStreamQuery(txt, options)
}

View File

@ -1,3 +1,5 @@
'use strict';
var CopyToQueryStream = require('./copy-to')
module.exports = {
to: function(txt, options) {

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('assert')
var gonna = require('gonna')
@ -19,7 +21,7 @@ var testBinaryCopy = function() {
var fromClient = client()
var toClient = client()
queries = [
var queries = [
'DROP TABLE IF EXISTS data',
'CREATE TABLE IF NOT EXISTS data (num BIGINT, word TEXT)',
'INSERT INTO data (num, word) VALUES (1, \'hello\'), (2, \'other thing\'), (3, \'goodbye\')',
@ -33,7 +35,7 @@ var testBinaryCopy = function() {
var fromStream = fromClient.query(to('COPY (SELECT * FROM data) TO STDOUT BINARY'))
var toStream = toClient.query(from('COPY data_copy FROM STDIN BINARY'))
runStream = function(callback) {
var runStream = function(callback) {
fromStream.on('error', callback)
toStream.on('error', callback)
toStream.on('finish', callback)

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('assert')
var gonna = require('gonna')

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('assert')
var gonna = require('gonna')
@ -118,5 +120,3 @@ var testNoticeResponse = function() {
}
testNoticeResponse();

View File

@ -1,3 +1,5 @@
'use strict';
require('./copy-from')
require('./copy-to')
require('./binary')