Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async TRANSACTION() {
try {
const client = await get_connection(pool);
const client_query = query_fn(client);
await BEGIN(client);
function QUERY(texts, ...values) {
return base_query(client_query, texts, values);
}
const QUERY1 = pipe(QUERY, first),
ASSOCIATE = baseAssociate(QUERY),
ASSOCIATE1 = pipe(ASSOCIATE, first);
return {
VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL,
QUERY,
QUERY1,
ASSOCIATE,
ASSOCIATE1,
LJOIN: use_ljoin && ljoin ? await ljoin(QUERY) : null,
COMMIT: _ => COMMIT(client),
ROLLBACK: _ => ROLLBACK(client)
}
} catch (e) { throw e; }
}
}
async TRANSACTION() {
try {
const client = await get_connection(pool);
const client_query = query_fn(client);
await BEGIN(client);
function QUERY(texts, ...values) {
return base_query(client_query, texts, values);
}
const QUERY1 = pipe(QUERY, first),
ASSOCIATE = baseAssociate(QUERY),
ASSOCIATE1 = pipe(ASSOCIATE, first);
return {
VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL,
QUERY,
QUERY1,
ASSOCIATE,
ASSOCIATE1,
LJOIN: use_ljoin && ljoin ? await ljoin(QUERY) : null,
COMMIT: _ => COMMIT(client),
ROLLBACK: _ => ROLLBACK(client)
}
} catch (e) { throw e; }
}
}
} catch (e) {
FxSQL_DEBUG.ERROR_WITH_SQL &&
(e.stack = `\nFxSQL_DEBUG.ERROR_WITH_SQL:\n text: ${query.text}\n values: ${JSON.stringify(query.values)}\n${e.stack}`);
throw e;
}
}
function QUERY(texts, ...values) {
return base_query(pool_query, texts, values);
}
function END() {
return end_pool(pool);
}
const QUERY1 = pipe(QUERY, first),
ASSOCIATE = baseAssociate(QUERY),
ASSOCIATE1 = pipe(ASSOCIATE, first);
var ljoin = null;
async function LOAD_LJOIN(QUERY) {
if (!ljoin) ljoin = await load_ljoin({
ready_sqls, add_column, tag, FxSQL_DEBUG,
connection_info, QUERY, VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS
});
return ljoin(QUERY);
}
return {
POOL: pool,
VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS, FxSQL_DEBUG,
query_fn: pool => pipe(pool.query.bind(pool), res => res.rows),
(e.stack = `\nFxSQL_DEBUG.ERROR_WITH_SQL:\n text: ${query.text}\n values: ${JSON.stringify(query.values)}\n${e.stack}`);
throw e;
}
}
function QUERY(texts, ...values) {
return base_query(pool_query, texts, values);
}
function END() {
return end_pool(pool);
}
const QUERY1 = pipe(QUERY, first),
ASSOCIATE = baseAssociate(QUERY),
ASSOCIATE1 = pipe(ASSOCIATE, first);
var ljoin = null;
async function LOAD_LJOIN(QUERY) {
if (!ljoin) ljoin = await load_ljoin({
ready_sqls, add_column, tag, FxSQL_DEBUG,
connection_info, QUERY, VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS
});
return ljoin(QUERY);
}
return {
POOL: pool,
VALUES, IN, NOT_IN, EQ, SET, COLUMN, CL, TABLE, TB, SQL, SQLS, FxSQL_DEBUG,
QUERY,
QUERY1,