Skip to content

Commit 8928b2a

Browse files
Change insert * and update * to declaring specific columns (backport #3047) (#3188)
Co-authored-by: Justin Barnett <61020572+jusbar23@users.noreply.github.com>
1 parent da70b32 commit 8928b2a

File tree

11 files changed

+40
-12
lines changed

11 files changed

+40
-12
lines changed

indexer/services/auxo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "eslint --ext .ts,.js .",
1313
"lint:fix": "eslint --ext .ts,.js . --fix",
1414
"test": "NODE_ENV=test jest --runInBand --forceExit",
15-
"test:clean": "pnpm run build; NODE_ENV=test jest --runInBand --forceExit",
15+
"test:clean": "pnpm run build && pnpm run test",
1616
"postinstall": "patch-package"
1717
},
1818
"author": "",

indexer/services/bazooka/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "eslint --ext .ts,.js .",
1313
"lint:fix": "eslint --ext .ts,.js . --fix",
1414
"test": "NODE_ENV=test jest --runInBand --forceExit",
15-
"test:clean": "pnpm run build; NODE_ENV=test jest --runInBand --forceExit",
15+
"test:clean": "pnpm run build && pnpm run test",
1616
"postinstall": "patch-package"
1717
},
1818
"author": "",

indexer/services/comlink/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"lint": "eslint --ext .ts,.js .",
1515
"lint:fix": "eslint --ext .ts,.js . --fix",
1616
"test": "NODE_ENV=test jest --runInBand --forceExit",
17-
"test:clean": "pnpm run build; NODE_ENV=test jest --runInBand --forceExit",
17+
"test:clean": "pnpm run build && pnpm run test",
1818
"swagger": "ts-node -r dotenv-flow/config src/scripts/generate-swagger.ts",
1919
"gen-markdown": "widdershins public/swagger.json -o public/api-documentation.md --omitHeader --language_tabs 'python:Python' 'javascript:Javascript'"
2020
},

indexer/services/ender/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "eslint --ext .ts,.js .",
1313
"lint:fix": "eslint --ext .ts,.js . --fix",
1414
"test": "NODE_ENV=test jest --runInBand --forceExit",
15-
"test:clean": "pnpm run build; NODE_ENV=test jest --runInBand --forceExit",
15+
"test:clean": "pnpm run build && pnpm run test",
1616
"postinstall": "patch-package"
1717
},
1818
"author": "",

indexer/services/ender/src/scripts/handlers/dydx_market_price_update_handler.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ BEGIN
4343
oracle_price_record."marketId" = market_record_id;
4444
oracle_price_record."price" = oracle_price;
4545

46-
INSERT INTO oracle_prices VALUES (oracle_price_record.*);
46+
INSERT INTO oracle_prices (
47+
"id", "marketId", "price", "effectiveAt", "effectiveAtHeight"
48+
) VALUES (
49+
oracle_price_record."id", oracle_price_record."marketId",
50+
oracle_price_record."price", oracle_price_record."effectiveAt",
51+
oracle_price_record."effectiveAtHeight"
52+
);
4753

4854
RETURN jsonb_build_object(
4955
'market',

indexer/services/ender/src/scripts/handlers/dydx_perpetual_market_v2_handler.sql

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,24 @@ BEGIN
2929
perpetual_market_record."marketType" = dydx_protocol_market_type_to_perpetual_market_type(event_data->'marketType');
3030
perpetual_market_record."baseOpenInterest" = 0;
3131

32-
INSERT INTO perpetual_markets VALUES (perpetual_market_record.*) RETURNING * INTO perpetual_market_record;
32+
INSERT INTO perpetual_markets (
33+
"id", "clobPairId", "ticker", "marketId", "status", "priceChange24H",
34+
"trades24H", "volume24H", "nextFundingRate", "openInterest",
35+
"quantumConversionExponent", "atomicResolution", "subticksPerTick",
36+
"stepBaseQuantums", "liquidityTierId", "marketType", "baseOpenInterest"
37+
) VALUES (
38+
perpetual_market_record."id", perpetual_market_record."clobPairId", perpetual_market_record."ticker",
39+
perpetual_market_record."marketId", perpetual_market_record."status", perpetual_market_record."priceChange24H",
40+
perpetual_market_record."trades24H", perpetual_market_record."volume24H", perpetual_market_record."nextFundingRate",
41+
perpetual_market_record."openInterest", perpetual_market_record."quantumConversionExponent",
42+
perpetual_market_record."atomicResolution", perpetual_market_record."subticksPerTick",
43+
perpetual_market_record."stepBaseQuantums", perpetual_market_record."liquidityTierId",
44+
perpetual_market_record."marketType", perpetual_market_record."baseOpenInterest"
45+
) RETURNING "id", "clobPairId", "ticker", "marketId", "status", "priceChange24H",
46+
"trades24H", "volume24H", "nextFundingRate", "openInterest",
47+
"quantumConversionExponent", "atomicResolution", "subticksPerTick",
48+
"stepBaseQuantums", "liquidityTierId", "marketType", "baseOpenInterest"
49+
INTO perpetual_market_record;
3350

3451
RETURN jsonb_build_object(
3552
'perpetual_market',

indexer/services/ender/src/scripts/handlers/dydx_subaccount_update_handler.sql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ BEGIN
3838
subaccount_record."subaccountNumber" = jsonb_extract_path(event_data, 'subaccountId', 'number')::int;
3939
subaccount_record."updatedAtHeight" = block_height;
4040
subaccount_record."updatedAt" = block_time;
41-
INSERT INTO subaccounts
42-
VALUES (subaccount_record.*)
41+
INSERT INTO subaccounts (
42+
"id", "address", "subaccountNumber", "updatedAtHeight", "updatedAt"
43+
) VALUES (
44+
subaccount_record."id", subaccount_record."address",
45+
subaccount_record."subaccountNumber", subaccount_record."updatedAtHeight",
46+
subaccount_record."updatedAt"
47+
)
4348
ON CONFLICT ("id") DO UPDATE
4449
SET "updatedAtHeight" = subaccount_record."updatedAtHeight", "updatedAt" = subaccount_record."updatedAt";
4550

indexer/services/example-service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "eslint --ext .ts,.js .",
1313
"lint:fix": "eslint --ext .ts,.js . --fix",
1414
"test": "NODE_ENV=test jest --runInBand --forceExit",
15-
"test:clean": "pnpm run build; NODE_ENV=test jest --runInBand --forceExit"
15+
"test:clean": "pnpm run build && pnpm run test"
1616
},
1717
"author": "",
1818
"license": "BSL",

indexer/services/roundtable/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "eslint --ext .ts,.js .",
1313
"lint:fix": "eslint --ext .ts,.js . --fix",
1414
"test": "NODE_ENV=test jest --runInBand --forceExit",
15-
"test:clean": "pnpm run build; NODE_ENV=test jest --runInBand --forceExit",
15+
"test:clean": "pnpm run build && pnpm run test",
1616
"postinstall": "patch-package"
1717
},
1818
"author": "",

indexer/services/socks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "eslint --ext .ts,.js .",
1313
"lint:fix": "eslint --ext .ts,.js . --fix",
1414
"test": "NODE_ENV=test jest --maxWorkers 1 --forceExit",
15-
"test:clean": "pnpm run build; NODE_ENV=test jest --maxWorkers 1 --forceExit",
15+
"test:clean": "pnpm run build && pnpm run test",
1616
"postinstall": "patch-package"
1717
},
1818
"author": "",

0 commit comments

Comments
 (0)