feat(postgresql): add auth and primitive actions

This commit is contained in:
Shehab Ghazy
2023-05-03 13:47:29 +03:00
committed by Ali BARIN
parent 9776c9f5a4
commit 0c8343e76f
12 changed files with 576 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
import { Knex } from 'knex'
import logger from '../../../helpers/logger';
const setParams = async ($: IGlobalVariable, client: Knex<any, unknown[]>) : Promise<Knex.Raw<any>> => {
const params : any = $.step.parameters.params
let paramsObj : IJSONObject = {}
params.forEach( (ele: any) => { paramsObj[ele.configParam] = ele.value } )
for (const key in paramsObj) {
const res = await client.raw(`SET ${key} = '${paramsObj[key]}'`);
}
};
export default setParams;