sql camel case

This commit is contained in:
Benjamin Wilson
2025-02-25 19:11:10 -05:00
parent 864867ffd4
commit 19f49b74e6
@@ -50,22 +50,22 @@ export class ClientStatisticsService {
// Step 2: Use a temp table and single UPDATE
await this.clientStatisticsRepository.query(`
CREATE TEMP TABLE temp_stats (
clientId UUID,
"clientId" UUID,
time BIGINT,
shares INT,
acceptedCount INT,
updatedAt TIMESTAMP
"acceptedCount" INT,
"updatedAt" TIMESTAMP
) ON COMMIT DROP;
INSERT INTO temp_stats (clientId, time, shares, acceptedCount, updatedAt)
INSERT INTO temp_stats ("clientId", time, shares, "acceptedCount", "updatedAt")
VALUES ${values};
UPDATE "client_statistics_entity" cse
SET shares = ts.shares,
acceptedCount = ts.acceptedCount,
updatedAt = ts.updatedAt
"acceptedCount" = ts."acceptedCount",
"updatedAt" = ts."updatedAt"
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 = [];