Cleanup some dead code

This commit is contained in:
Brian M. Carlson 2020-07-15 12:22:13 -05:00
parent 5ba7e3fb48
commit 9bf31060e1
2 changed files with 21 additions and 34 deletions

View File

@ -154,13 +154,11 @@ class Connection extends EventEmitter {
}
// send bind message
// "more" === true to buffer the message until flush() is called
bind(config) {
this._send(serialize.bind(config))
}
// send execute message
// "more" === true to buffer the message until flush() is called
execute(config) {
this._send(serialize.execute(config))
}

View File

@ -176,30 +176,26 @@ class Query extends EventEmitter {
}
_getRows(connection, rows) {
connection.execute(
{
portal: this.portal,
rows: rows,
},
true
)
connection.execute({
portal: this.portal,
rows: rows,
})
connection.flush()
}
// http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
prepare(connection) {
// prepared statements need sync to be called after each command
// complete or when an error is encountered
this.isPreparedStatement = true
// TODO refactor this poor encapsulation
if (!this.hasBeenParsed(connection)) {
connection.parse(
{
text: this.text,
name: this.name,
types: this.types,
},
true
)
connection.parse({
text: this.text,
name: this.name,
types: this.types,
})
}
if (this.values) {
@ -211,24 +207,17 @@ class Query extends EventEmitter {
}
}
// http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
connection.bind(
{
portal: this.portal,
statement: this.name,
values: this.values,
binary: this.binary,
},
true
)
connection.bind({
portal: this.portal,
statement: this.name,
values: this.values,
binary: this.binary,
})
connection.describe(
{
type: 'P',
name: this.portal || '',
},
true
)
connection.describe({
type: 'P',
name: this.portal || '',
})
this._getRows(connection, this.rows)
}