Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/share/.cache/yarn/v6/npm-knex-2.4.0-integrity/node_modules/knex/lib/dialects/redshift/ drwxr-xr-x | |
| Viewing file: Select action/file-type: // Redshift
// -------
const Client_PG = require('../postgres');
const map = require('lodash/map');
const Transaction = require('./transaction');
const QueryCompiler = require('./query/redshift-querycompiler');
const ColumnBuilder = require('./schema/redshift-columnbuilder');
const ColumnCompiler = require('./schema/redshift-columncompiler');
const TableCompiler = require('./schema/redshift-tablecompiler');
const SchemaCompiler = require('./schema/redshift-compiler');
const ViewCompiler = require('./schema/redshift-viewcompiler');
class Client_Redshift extends Client_PG {
transaction() {
return new Transaction(this, ...arguments);
}
queryCompiler(builder, formatter) {
return new QueryCompiler(this, builder, formatter);
}
columnBuilder() {
return new ColumnBuilder(this, ...arguments);
}
columnCompiler() {
return new ColumnCompiler(this, ...arguments);
}
tableCompiler() {
return new TableCompiler(this, ...arguments);
}
schemaCompiler() {
return new SchemaCompiler(this, ...arguments);
}
viewCompiler() {
return new ViewCompiler(this, ...arguments);
}
_driver() {
return require('pg');
}
// Ensures the response is returned in the same format as other clients.
processResponse(obj, runner) {
const resp = obj.response;
if (obj.output) return obj.output.call(runner, resp);
if (obj.method === 'raw') return resp;
if (resp.command === 'SELECT') {
if (obj.method === 'first') return resp.rows[0];
if (obj.method === 'pluck') return map(resp.rows, obj.pluck);
return resp.rows;
}
if (
resp.command === 'INSERT' ||
resp.command === 'UPDATE' ||
resp.command === 'DELETE'
) {
return resp.rowCount;
}
return resp;
}
toPathForJson(jsonPath, builder, bindingsHolder) {
return jsonPath
.replace(/^(\$\.)/, '') // remove the first dollar
.split('.')
.map(
function (v) {
return this.parameter(v, builder, bindingsHolder);
}.bind(this)
)
.join(', ');
}
}
Object.assign(Client_Redshift.prototype, {
dialect: 'redshift',
driverName: 'pg-redshift',
});
module.exports = Client_Redshift;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0149 ]-- |