Files
khatru/go.mod
bndw ae641fd24d refactor(postgres): make SQL generation testable
Decouples the postgresql sql generation from the query execution.
This allows the logic for building sql to be unit tested without
access to a database.

This work was motivated when a client was not receiving events as
expected. In debugging I found that if a tag's value was an empty array,
then no query would be executed - and to my surprised no error is
raised either. I wanted to get a better sense of the current constraints on
when queries are and are not executed, but I had a hard time keeping the
code in my head. This led me to extracting the sql generation into its
own function and writing the unit tests that document its current
behavior. This refactor makes no changes to the current logic. I have added
some REVIEW comments in the test cases where I thought some error handling
could be introduced but I wanted to first see if you were receptive to this
refactor before proposing any functional changes.
2023-05-02 12:41:51 -03:00

94 lines
4.4 KiB
Modula-2

module github.com/fiatjaf/relayer/v2
go 1.18
require (
github.com/PuerkitoBio/goquery v1.8.0
github.com/aquasecurity/esquery v0.2.0
github.com/cockroachdb/pebble v0.0.0-20220723153705-3fc374e4dc66
github.com/elastic/go-elasticsearch/v8 v8.6.0
github.com/fiatjaf/relayer v1.7.3
github.com/gorilla/websocket v1.5.0
github.com/grokify/html-strip-tags-go v0.0.1
github.com/jb55/lnsocket/go v0.0.0-20220725174341-b98b5cd37bb6
github.com/jmoiron/sqlx v1.3.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/lib/pq v1.10.3
github.com/mattn/go-sqlite3 v1.14.6
github.com/mmcdole/gofeed v1.1.3
github.com/nbd-wtf/go-nostr v0.17.1
github.com/rif/cache2go v1.0.0
github.com/rs/cors v1.7.0
github.com/stevelacy/daz v0.1.4
github.com/stretchr/testify v1.8.0
github.com/tidwall/gjson v1.14.1
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2
)
require (
github.com/DataDog/zstd v1.4.5 // indirect
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/SaveTheRbtz/generic-sync-map-go v0.0.0-20230201052002-6c5833b989be // indirect
github.com/aead/siphash v1.0.1 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/btcsuite/btcd v0.23.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/btcsuite/btcd/btcutil/psbt v1.1.4 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/btcsuite/btcwallet v0.15.1 // indirect
github.com/btcsuite/btcwallet/wallet/txauthor v1.2.3 // indirect
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0 // indirect
github.com/btcsuite/btcwallet/wallet/txsizes v1.1.0 // indirect
github.com/btcsuite/btcwallet/walletdb v1.4.0 // indirect
github.com/btcsuite/btcwallet/wtxmgr v1.5.0 // indirect
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cockroachdb/errors v1.8.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
github.com/cockroachdb/redact v1.0.8 // indirect
github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/decred/dcrd/lru v1.0.0 // indirect
github.com/elastic/elastic-transport-go/v8 v8.0.0-20211216131617-bbee439d559c // indirect
github.com/elastic/go-elasticsearch/v7 v7.6.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/kkdai/bstream v1.0.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
github.com/lightninglabs/neutrino v0.14.2 // indirect
github.com/lightningnetwork/lnd v0.15.0-beta // indirect
github.com/lightningnetwork/lnd/clock v1.1.0 // indirect
github.com/lightningnetwork/lnd/queue v1.1.0 // indirect
github.com/lightningnetwork/lnd/ticker v1.1.0 // indirect
github.com/lightningnetwork/lnd/tlv v1.0.3 // indirect
github.com/lightningnetwork/lnd/tor v1.0.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)