refactor(postgresql): rename pgClient with client
This commit is contained in:
@@ -41,11 +41,11 @@ export default defineAction({
|
|||||||
],
|
],
|
||||||
|
|
||||||
async run($) {
|
async run($) {
|
||||||
const pgClient = getClient($);
|
const client = getClient($);
|
||||||
await setParams(pgClient, $.step.parameters.params);
|
await setParams(client, $.step.parameters.params);
|
||||||
|
|
||||||
const queryStatemnt = $.step.parameters.queryStatement;
|
const queryStatemnt = $.step.parameters.queryStatement;
|
||||||
const { rows } = await pgClient.raw(queryStatemnt);
|
const { rows } = await client.raw(queryStatemnt);
|
||||||
|
|
||||||
$.setActionItem({
|
$.setActionItem({
|
||||||
raw: {
|
raw: {
|
||||||
|
@@ -3,8 +3,8 @@ import logger from '../../../helpers/logger';
|
|||||||
import getClient from '../common/postgres-client';
|
import getClient from '../common/postgres-client';
|
||||||
|
|
||||||
const verifyCredentials = async ($: IGlobalVariable) => {
|
const verifyCredentials = async ($: IGlobalVariable) => {
|
||||||
const pgClient = getClient($);
|
const client = getClient($);
|
||||||
const checkConnection = await pgClient.raw('SELECT 1');
|
const checkConnection = await client.raw('SELECT 1');
|
||||||
|
|
||||||
logger.debug(checkConnection);
|
logger.debug(checkConnection);
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@ import knex, { Knex } from 'knex';
|
|||||||
import { IGlobalVariable } from '@automatisch/types';
|
import { IGlobalVariable } from '@automatisch/types';
|
||||||
|
|
||||||
const getClient = ($: IGlobalVariable): Knex<any, unknown[]> => {
|
const getClient = ($: IGlobalVariable): Knex<any, unknown[]> => {
|
||||||
const pgClient = knex({
|
const client = knex({
|
||||||
client: 'pg',
|
client: 'pg',
|
||||||
version: $.auth.data.version as string,
|
version: $.auth.data.version as string,
|
||||||
connection: {
|
connection: {
|
||||||
@@ -14,7 +14,7 @@ const getClient = ($: IGlobalVariable): Knex<any, unknown[]> => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return pgClient;
|
return client;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default getClient;
|
export default getClient;
|
||||||
|
Reference in New Issue
Block a user