vault backup: 2023-11-03 14:34:27
This commit is contained in:
parent
7a4e6b0260
commit
cfa7960157
4
api.ts
4
api.ts
@ -29,7 +29,7 @@ const client = new Client({
|
|||||||
await client.connect();
|
await client.connect();
|
||||||
|
|
||||||
// Load SQL from file
|
// Load SQL from file
|
||||||
const query = await Deno.readTextFile("sql/hist.sql");
|
const query = await Deno.readTextFile("sql/get.pg.sql");
|
||||||
|
|
||||||
// Define a route to retrieve values from the database using parameters
|
// Define a route to retrieve values from the database using parameters
|
||||||
router.get('/price_info/part_cust/:partcode/:customer', async (ctx) => {
|
router.get('/price_info/part_cust/:partcode/:customer', async (ctx) => {
|
||||||
@ -39,7 +39,7 @@ router.get('/price_info/part_cust/:partcode/:customer', async (ctx) => {
|
|||||||
|
|
||||||
//console.log(partcode)
|
//console.log(partcode)
|
||||||
//console.log(customer)
|
//console.log(customer)
|
||||||
const result = await client.queryObject({args: [partcode, customer], text: query} );
|
const result = await client.queryObject({args: [customer, customer, partcode], text: query} );
|
||||||
ctx.response.body = result.rows;
|
ctx.response.body = result.rows;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
sql/get.pg.sql
Normal file
2
sql/get.pg.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
--select gg.d from rlarp.get_guidance('DIAM0004','DIAM0004','AMK06000G18B054',5000,2024) gg(d);
|
||||||
|
select gg.d from rlarp.get_guidance($1,$2, $3, 5000,2024) gg(d);
|
Loading…
Reference in New Issue
Block a user