Skip to content

Commit

Permalink
dprint
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-iohk committed Jan 9, 2025
1 parent 663077f commit 60df902
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-dprint
- run: npm i -g sql-formatter
- run: npm i -g sql-formatter@15.4.9
- uses: actions/checkout@v4
- uses: dprint/[email protected]
with:
config-path: dprint.jsonc
dprint-version: 0.47.2

cspell:
runs-on: ubuntu-latest
Expand Down
11 changes: 4 additions & 7 deletions sql/migrations/apply_search_tx_optimizations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ FROM

-- NEXT --
-- Create the trigger function to insert a new row into user_commands_aggregated
CREATE
OR REPLACE function add_to_user_commands_aggregated () returns trigger AS $$
CREATE OR REPLACE FUNCTION add_to_user_commands_aggregated () returns trigger AS $$
BEGIN
-- Insert a new row into user_commands_aggregated only if the corresponding entry doesn't already exist
INSERT INTO user_commands_aggregated (
Expand Down Expand Up @@ -116,7 +115,7 @@ $$ language plpgsql;
-- NEXT --
-- Create the trigger that fires after each insert into blocks_user_commands
CREATE
OR REPLACE trigger trigger_add_to_user_commands_aggregated
OR replace trigger trigger_add_to_user_commands_aggregated
AFTER insert ON blocks_user_commands FOR each ROW
EXECUTE function add_to_user_commands_aggregated ();

Expand Down Expand Up @@ -172,8 +171,7 @@ FROM

-- NEXT --
-- Create the trigger function to insert a new row into internal_commands_aggregated
CREATE
OR REPLACE function add_to_internal_commands_aggregated () returns trigger AS $$
CREATE OR REPLACE FUNCTION add_to_internal_commands_aggregated () returns trigger AS $$
BEGIN
-- Insert a new row into internal_commands_aggregated only if the corresponding entry doesn't already exist
INSERT INTO internal_commands_aggregated (
Expand Down Expand Up @@ -273,8 +271,7 @@ FROM

-- NEXT --
-- Create the trigger function to insert a new row into zkapp_commands_aggregated
CREATE
OR REPLACE function add_to_zkapp_commands_aggregated () returns trigger AS $$
CREATE OR REPLACE FUNCTION add_to_zkapp_commands_aggregated () returns trigger AS $$
BEGIN
-- Insert a new row into zkapp_commands_aggregated only if the corresponding entry doesn't already exist
INSERT INTO zkapp_commands_aggregated (
Expand Down
2 changes: 1 addition & 1 deletion sql/queries/indexer_internal_commands.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WITH
b.chain_status='pending'
AND b.height>(
SELECT
max(HEIGHT)
max(height)
FROM
blocks
WHERE
Expand Down
2 changes: 1 addition & 1 deletion sql/queries/indexer_internal_commands_optimized.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WITH
b.chain_status='pending'
AND b.height>(
SELECT
max(HEIGHT)
max(height)
FROM
blocks
WHERE
Expand Down
2 changes: 1 addition & 1 deletion sql/queries/indexer_user_commands.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WITH
b.chain_status='pending'
AND b.height>(
SELECT
max(HEIGHT)
max(height)
FROM
blocks
WHERE
Expand Down
2 changes: 1 addition & 1 deletion sql/queries/indexer_user_commands_optimized.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WITH
b.chain_status='pending'
AND b.height>(
SELECT
max(HEIGHT)
max(height)
FROM
blocks
WHERE
Expand Down
2 changes: 1 addition & 1 deletion sql/queries/indexer_zkapp_commands.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WITH
b.chain_status='pending'
AND b.height>(
SELECT
max(HEIGHT)
max(height)
FROM
blocks
WHERE
Expand Down
2 changes: 1 addition & 1 deletion sql/queries/indexer_zkapp_commands_optimized.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WITH
b.chain_status='pending'
AND b.height>(
SELECT
max(HEIGHT)
max(height)
FROM
blocks
WHERE
Expand Down
2 changes: 1 addition & 1 deletion sql/queries/max_canonical_height.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SELECT
max(HEIGHT) AS max_canonical_height
max(height) AS max_canonical_height
FROM
blocks
WHERE
Expand Down
4 changes: 2 additions & 2 deletions sql/queries/maybe_block.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
SELECT
HEIGHT,
height,
state_hash,
global_slot_since_genesis
FROM
blocks
WHERE
HEIGHT=$1
height=$1
AND chain_status='canonical'
2 changes: 1 addition & 1 deletion sql/queries/oldest_block.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SELECT
HEIGHT,
height,
state_hash
FROM
blocks
Expand Down

0 comments on commit 60df902

Please sign in to comment.