From c5862898a852081c2700d1c6f1df389246510c19 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Thu, 30 May 2024 12:39:24 -0300 Subject: [PATCH] sqlc: remove trailing spaces in queries --- loopdb/sqlc/batch.sql.go | 2 +- loopdb/sqlc/instantout.sql.go | 4 ++-- loopdb/sqlc/queries/batch.sql | 2 +- loopdb/sqlc/queries/instantout.sql | 4 ++-- loopdb/sqlc/queries/swaps.sql | 12 ++++++------ loopdb/sqlc/swaps.sql.go | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/loopdb/sqlc/batch.sql.go b/loopdb/sqlc/batch.sql.go index c8fab1f..b344c71 100644 --- a/loopdb/sqlc/batch.sql.go +++ b/loopdb/sqlc/batch.sql.go @@ -184,7 +184,7 @@ WHERE sweeps.swap_hash = $1 AND sweeps.completed = TRUE -AND +AND sweep_batches.confirmed = TRUE ` diff --git a/loopdb/sqlc/instantout.sql.go b/loopdb/sqlc/instantout.sql.go index 73fb0ac..fac01ae 100644 --- a/loopdb/sqlc/instantout.sql.go +++ b/loopdb/sqlc/instantout.sql.go @@ -133,7 +133,7 @@ func (q *Queries) GetInstantOutSwapUpdates(ctx context.Context, swapHash []byte) } const getInstantOutSwaps = `-- name: GetInstantOutSwaps :many -SELECT +SELECT swaps.id, swaps.swap_hash, swaps.preimage, swaps.initiation_time, swaps.amount_requested, swaps.cltv_expiry, swaps.max_miner_fee, swaps.max_swap_fee, swaps.initiation_height, swaps.protocol_version, swaps.label, instantout_swaps.swap_hash, instantout_swaps.preimage, instantout_swaps.sweep_address, instantout_swaps.outgoing_chan_set, instantout_swaps.htlc_fee_rate, instantout_swaps.reservation_ids, instantout_swaps.swap_invoice, instantout_swaps.finalized_htlc_tx, instantout_swaps.sweep_tx_hash, instantout_swaps.finalized_sweepless_sweep_tx, instantout_swaps.sweep_confirmation_height, htlc_keys.swap_hash, htlc_keys.sender_script_pubkey, htlc_keys.receiver_script_pubkey, htlc_keys.sender_internal_pubkey, htlc_keys.receiver_internal_pubkey, htlc_keys.client_key_family, htlc_keys.client_key_index @@ -235,7 +235,7 @@ func (q *Queries) GetInstantOutSwaps(ctx context.Context) ([]GetInstantOutSwapsR const insertInstantOut = `-- name: InsertInstantOut :exec INSERT INTO instantout_swaps ( swap_hash, - preimage, + preimage, sweep_address, outgoing_chan_set, htlc_fee_rate, diff --git a/loopdb/sqlc/queries/batch.sql b/loopdb/sqlc/queries/batch.sql index 5951dfe..49d21ac 100644 --- a/loopdb/sqlc/queries/batch.sql +++ b/loopdb/sqlc/queries/batch.sql @@ -76,7 +76,7 @@ WHERE sweeps.swap_hash = $1 AND sweeps.completed = TRUE -AND +AND sweep_batches.confirmed = TRUE; -- name: GetBatchSweptAmount :one diff --git a/loopdb/sqlc/queries/instantout.sql b/loopdb/sqlc/queries/instantout.sql index 56f9052..4b37a2f 100644 --- a/loopdb/sqlc/queries/instantout.sql +++ b/loopdb/sqlc/queries/instantout.sql @@ -1,7 +1,7 @@ -- name: InsertInstantOut :exec INSERT INTO instantout_swaps ( swap_hash, - preimage, + preimage, sweep_address, outgoing_chan_set, htlc_fee_rate, @@ -53,7 +53,7 @@ WHERE swaps.swap_hash = $1; -- name: GetInstantOutSwaps :many -SELECT +SELECT swaps.*, instantout_swaps.*, htlc_keys.* diff --git a/loopdb/sqlc/queries/swaps.sql b/loopdb/sqlc/queries/swaps.sql index 8d8dd66..effcb06 100644 --- a/loopdb/sqlc/queries/swaps.sql +++ b/loopdb/sqlc/queries/swaps.sql @@ -1,9 +1,9 @@ -- name: GetLoopOutSwaps :many -SELECT +SELECT swaps.*, loopout_swaps.*, htlc_keys.* -FROM +FROM swaps JOIN loopout_swaps ON swaps.swap_hash = loopout_swaps.swap_hash @@ -13,7 +13,7 @@ ORDER BY swaps.id; -- name: GetLoopOutSwap :one -SELECT +SELECT swaps.*, loopout_swaps.*, htlc_keys.* @@ -27,7 +27,7 @@ WHERE swaps.swap_hash = $1; -- name: GetLoopInSwaps :many -SELECT +SELECT swaps.*, loopin_swaps.*, htlc_keys.* @@ -41,7 +41,7 @@ ORDER BY swaps.id; -- name: GetLoopInSwap :one -SELECT +SELECT swaps.*, loopin_swaps.*, htlc_keys.* @@ -55,7 +55,7 @@ WHERE swaps.swap_hash = $1; -- name: GetSwapUpdates :many -SELECT +SELECT * FROM swap_updates diff --git a/loopdb/sqlc/swaps.sql.go b/loopdb/sqlc/swaps.sql.go index cda5dec..e5cda44 100644 --- a/loopdb/sqlc/swaps.sql.go +++ b/loopdb/sqlc/swaps.sql.go @@ -11,7 +11,7 @@ import ( ) const getLoopInSwap = `-- name: GetLoopInSwap :one -SELECT +SELECT swaps.id, swaps.swap_hash, swaps.preimage, swaps.initiation_time, swaps.amount_requested, swaps.cltv_expiry, swaps.max_miner_fee, swaps.max_swap_fee, swaps.initiation_height, swaps.protocol_version, swaps.label, loopin_swaps.swap_hash, loopin_swaps.htlc_conf_target, loopin_swaps.last_hop, loopin_swaps.external_htlc, htlc_keys.swap_hash, htlc_keys.sender_script_pubkey, htlc_keys.receiver_script_pubkey, htlc_keys.sender_internal_pubkey, htlc_keys.receiver_internal_pubkey, htlc_keys.client_key_family, htlc_keys.client_key_index @@ -81,7 +81,7 @@ func (q *Queries) GetLoopInSwap(ctx context.Context, swapHash []byte) (GetLoopIn } const getLoopInSwaps = `-- name: GetLoopInSwaps :many -SELECT +SELECT swaps.id, swaps.swap_hash, swaps.preimage, swaps.initiation_time, swaps.amount_requested, swaps.cltv_expiry, swaps.max_miner_fee, swaps.max_swap_fee, swaps.initiation_height, swaps.protocol_version, swaps.label, loopin_swaps.swap_hash, loopin_swaps.htlc_conf_target, loopin_swaps.last_hop, loopin_swaps.external_htlc, htlc_keys.swap_hash, htlc_keys.sender_script_pubkey, htlc_keys.receiver_script_pubkey, htlc_keys.sender_internal_pubkey, htlc_keys.receiver_internal_pubkey, htlc_keys.client_key_family, htlc_keys.client_key_index @@ -167,7 +167,7 @@ func (q *Queries) GetLoopInSwaps(ctx context.Context) ([]GetLoopInSwapsRow, erro } const getLoopOutSwap = `-- name: GetLoopOutSwap :one -SELECT +SELECT swaps.id, swaps.swap_hash, swaps.preimage, swaps.initiation_time, swaps.amount_requested, swaps.cltv_expiry, swaps.max_miner_fee, swaps.max_swap_fee, swaps.initiation_height, swaps.protocol_version, swaps.label, loopout_swaps.swap_hash, loopout_swaps.dest_address, loopout_swaps.swap_invoice, loopout_swaps.max_swap_routing_fee, loopout_swaps.sweep_conf_target, loopout_swaps.htlc_confirmations, loopout_swaps.outgoing_chan_set, loopout_swaps.prepay_invoice, loopout_swaps.max_prepay_routing_fee, loopout_swaps.publication_deadline, loopout_swaps.single_sweep, loopout_swaps.payment_timeout, htlc_keys.swap_hash, htlc_keys.sender_script_pubkey, htlc_keys.receiver_script_pubkey, htlc_keys.sender_internal_pubkey, htlc_keys.receiver_internal_pubkey, htlc_keys.client_key_family, htlc_keys.client_key_index @@ -253,11 +253,11 @@ func (q *Queries) GetLoopOutSwap(ctx context.Context, swapHash []byte) (GetLoopO } const getLoopOutSwaps = `-- name: GetLoopOutSwaps :many -SELECT +SELECT swaps.id, swaps.swap_hash, swaps.preimage, swaps.initiation_time, swaps.amount_requested, swaps.cltv_expiry, swaps.max_miner_fee, swaps.max_swap_fee, swaps.initiation_height, swaps.protocol_version, swaps.label, loopout_swaps.swap_hash, loopout_swaps.dest_address, loopout_swaps.swap_invoice, loopout_swaps.max_swap_routing_fee, loopout_swaps.sweep_conf_target, loopout_swaps.htlc_confirmations, loopout_swaps.outgoing_chan_set, loopout_swaps.prepay_invoice, loopout_swaps.max_prepay_routing_fee, loopout_swaps.publication_deadline, loopout_swaps.single_sweep, loopout_swaps.payment_timeout, htlc_keys.swap_hash, htlc_keys.sender_script_pubkey, htlc_keys.receiver_script_pubkey, htlc_keys.sender_internal_pubkey, htlc_keys.receiver_internal_pubkey, htlc_keys.client_key_family, htlc_keys.client_key_index -FROM +FROM swaps JOIN loopout_swaps ON swaps.swap_hash = loopout_swaps.swap_hash @@ -355,7 +355,7 @@ func (q *Queries) GetLoopOutSwaps(ctx context.Context) ([]GetLoopOutSwapsRow, er } const getSwapUpdates = `-- name: GetSwapUpdates :many -SELECT +SELECT id, swap_hash, update_timestamp, update_state, htlc_txhash, server_cost, onchain_cost, offchain_cost FROM swap_updates