Skip to content

Commit

Permalink
fix string quotation
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromtcosta committed Jun 21, 2022
1 parent cc9bc7d commit 1c1016c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/coin-price/db-api.ts
Expand Up @@ -32,7 +32,7 @@ export async function getLatestTicker(
): Promise<Ticker | undefined> {
return (
await db.query({
text: 'SELECT * from tickers WHERE "from"=$1 ORDER BY time DESC LIMIT 1',
text: "SELECT * from tickers WHERE \"from\"=$1 ORDER BY time DESC LIMIT 1",
values: [fromCurrency],
})
).rows.map(rowToTicker)[0];
Expand All @@ -49,7 +49,7 @@ export async function getTickers(
const result = await db.query({
text:
"SELECT * FROM tickers " +
'WHERE time<=$1 AND "from"=$2' +
"WHERE time<=$1 AND \"from\"=$2" +
"ORDER BY time DESC " +
"LIMIT 1;",
values: [time, fromCurrency],
Expand All @@ -67,7 +67,7 @@ export async function insertTicker(
ticker: Ticker
): Promise<void> {
await db.query({
text: 'INSERT INTO tickers("from", time, signature, prices) VALUES ($1, $2, $3, $4)',
text: "INSERT INTO tickers(\"from\", time, signature, prices) VALUES ($1, $2, $3, $4)",
values: [
ticker.from,
Math.floor(ticker.timestamp / 1000),
Expand Down

0 comments on commit 1c1016c

Please sign in to comment.