mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
sql camel case
This commit is contained in:
@@ -50,22 +50,22 @@ export class ClientStatisticsService {
|
|||||||
// Step 2: Use a temp table and single UPDATE
|
// Step 2: Use a temp table and single UPDATE
|
||||||
await this.clientStatisticsRepository.query(`
|
await this.clientStatisticsRepository.query(`
|
||||||
CREATE TEMP TABLE temp_stats (
|
CREATE TEMP TABLE temp_stats (
|
||||||
clientId UUID,
|
"clientId" UUID,
|
||||||
time BIGINT,
|
time BIGINT,
|
||||||
shares INT,
|
shares INT,
|
||||||
acceptedCount INT,
|
"acceptedCount" INT,
|
||||||
updatedAt TIMESTAMP
|
"updatedAt" TIMESTAMP
|
||||||
) ON COMMIT DROP;
|
) ON COMMIT DROP;
|
||||||
|
|
||||||
INSERT INTO temp_stats (clientId, time, shares, acceptedCount, updatedAt)
|
INSERT INTO temp_stats ("clientId", time, shares, "acceptedCount", "updatedAt")
|
||||||
VALUES ${values};
|
VALUES ${values};
|
||||||
|
|
||||||
UPDATE "client_statistics_entity" cse
|
UPDATE "client_statistics_entity" cse
|
||||||
SET shares = ts.shares,
|
SET shares = ts.shares,
|
||||||
acceptedCount = ts.acceptedCount,
|
"acceptedCount" = ts."acceptedCount",
|
||||||
updatedAt = ts.updatedAt
|
"updatedAt" = ts."updatedAt"
|
||||||
FROM temp_stats ts
|
FROM temp_stats ts
|
||||||
WHERE cse.clientId = ts.clientId AND cse.time = ts.time;
|
WHERE cse."clientId" = ts."clientId" AND cse.time = ts.time;
|
||||||
`);
|
`);
|
||||||
|
|
||||||
this.bulkAsyncUpdates = [];
|
this.bulkAsyncUpdates = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user