diff --git a/go.mod b/go.mod index a8f792fee..3b923d037 100644 --- a/go.mod +++ b/go.mod @@ -16,12 +16,14 @@ require ( github.com/gorilla/mux v1.7.1 github.com/gorilla/schema v1.1.0 github.com/graphql-go/graphql v0.7.9 + github.com/jackc/pgconn v1.6.1 + github.com/jackc/pgtype v1.4.0 + github.com/jackc/pgx/v4 v4.7.1 github.com/jtolds/monkit-hw/v2 v2.0.0-20191108235325-141a0da276b3 - github.com/lib/pq v1.3.0 github.com/mattn/go-sqlite3 v2.0.3+incompatible github.com/nsf/jsondiff v0.0.0-20160203110537-7de28ed2b6e3 github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d - github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114 + github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc github.com/sirupsen/logrus v1.5.0 // indirect github.com/spacemonkeygo/monkit/v3 v3.0.7-0.20200515175308-072401d8c752 github.com/spf13/cobra v0.0.6 @@ -33,7 +35,7 @@ require ( github.com/zeebo/errs v1.2.2 go.etcd.io/bbolt v1.3.4 go.uber.org/zap v1.15.0 - golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a golang.org/x/sys v0.0.0-20200610111108-226ff32320da diff --git a/go.sum b/go.sum index f8d5194bd..9316f7ea9 100644 --- a/go.sum +++ b/go.sum @@ -83,8 +83,10 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/cznic/b v0.0.0-20180115125044-35e9bbe41f07/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8= github.com/cznic/fileutil v0.0.0-20180108211300-6a051e75936f/go.mod h1:8S58EK26zhXSxzv7NQFpnliaOQsmDUxvoQO3rt154Vg= github.com/cznic/golex v0.0.0-20170803123110-4ab7c5e190e4/go.mod h1:+bmmJDNmKlhWNG+gwWCkaBoTy39Fs+bzRxVBzoTQbIc= @@ -138,6 +140,8 @@ github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZp github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gocql/gocql v0.0.0-20190301043612-f6df8288f9b4/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0= +github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= @@ -212,10 +216,60 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 h1:vr3AYkKovP8uR8AvSGGUK1IDqRa5lAAvEkZG1LKaCRc= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= +github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= +github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= +github.com/jackc/pgconn v1.6.1 h1:lwofaXKPbIx6qEaK8mNm7uZuOwxHw+PnAFGDsDFpkRI= +github.com/jackc/pgconn v1.6.1/go.mod h1:g8mKMqmSUO6AzAvha7vy07g1rbGOlc7iF0nU0ei83hc= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.0.2 h1:q1Hsy66zh4vuNsajBUF2PNqfAMMfxU5mk594lPE9vjY= +github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8 h1:Q3tB+ExeflWUW7AFcAhXqk40s9mnNYLk1nOkKNZ5GnU= +github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= +github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= +github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= +github.com/jackc/pgtype v1.4.0 h1:pHQfb4jh9iKqHyxPthq1fr+0HwSNIl3btYPbw2m2lbM= +github.com/jackc/pgtype v1.4.0/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= github.com/jackc/pgx v3.2.0+incompatible h1:0Vihzu20St42/UDsvZGdNE6jak7oi/UOeMzwMPHkgFY= github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= +github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= +github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= +github.com/jackc/pgx/v4 v4.7.1 h1:aqUSOcStk6fik+lSE+tqfFhvt/EwT8q/oMtJbP9CjXI= +github.com/jackc/pgx/v4 v4.7.1/go.mod h1:nu42q3aPjuC1M0Nak4bnoprKlXPINqopEKqbq5AZSC4= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -239,18 +293,29 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kshvakov/clickhouse v1.3.5/go.mod h1:DMzX7FxRymoNkVgizH0DWAL8Cur7wHLgx3MUnGwJqpE= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -318,16 +383,20 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114 h1:Pm6R878vxWWWR+Sa3ppsLce/Zq+JNTs6aVvRu13jv9A= -github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc h1:jUIKcSPO9MoMJBbEoyE/RJoE8vz7Mb8AjvifMMwSyvY= +github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -360,6 +429,7 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= @@ -396,6 +466,7 @@ github.com/zeebo/incenc v0.0.0-20180505221441-0d92902eec54 h1:+cwNE5KJ3pika4Huzm github.com/zeebo/incenc v0.0.0-20180505221441-0d92902eec54/go.mod h1:EI8LcOBDlSL3POyqwC1eJhOYlMBMidES+613EtmmT5w= github.com/zeebo/structs v1.0.2 h1:kvcd7s2LqXuO9cdV5LqrGHCOAfCBXaZpKCA3jD9SJIc= github.com/zeebo/structs v1.0.2/go.mod h1:LphfpprlqJQcbCq+eA3iIK/NsejMwk9mlfH/tM1XuKQ= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= @@ -406,6 +477,7 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -414,6 +486,7 @@ go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= @@ -422,14 +495,20 @@ golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -471,6 +550,7 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -502,6 +582,7 @@ golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190426135247-a129542de9ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -509,11 +590,15 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200107144601-ef85f5a75ddf/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200610111108-226ff32320da h1:bGb80FudwxpeucJUjPYJXuJ8Hk91vNtfvrymzwiei38= golang.org/x/sys v0.0.0-20200610111108-226ff32320da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -521,6 +606,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= @@ -534,6 +621,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425222832-ad9eeb80039a/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -541,6 +629,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -550,6 +639,8 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200428211428-0c9eba77bc32 h1:Xvf3ZQTm5bjXPxhI7g+dwqsCqadK1rcNtwtszuatetk= golang.org/x/tools v0.0.0-20200428211428-0c9eba77bc32/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -598,6 +689,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/private/dbutil/cockroachutil/db.go b/private/dbutil/cockroachutil/db.go index 0f496179a..075aa79f7 100644 --- a/private/dbutil/cockroachutil/db.go +++ b/private/dbutil/cockroachutil/db.go @@ -10,11 +10,11 @@ import ( "net/url" "strings" - "github.com/lib/pq" "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "storj.io/storj/private/dbutil" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/private/tagsql" ) @@ -50,13 +50,13 @@ func OpenUnique(ctx context.Context, connStr string, schemaPrefix string) (db *d return nil, errs.New("Could not open masterDB at conn %q: %w", connStr, err) } - _, err = masterDB.Exec(ctx, "CREATE DATABASE "+pq.QuoteIdentifier(schemaName)) + _, err = masterDB.Exec(ctx, "CREATE DATABASE "+pgutil.QuoteIdentifier(schemaName)) if err != nil { return nil, errs.Wrap(err) } cleanup := func(cleanupDB tagsql.DB) error { - _, err := cleanupDB.Exec(context.TODO(), "DROP DATABASE "+pq.QuoteIdentifier(schemaName)) + _, err := cleanupDB.Exec(context.TODO(), "DROP DATABASE "+pgutil.QuoteIdentifier(schemaName)) return errs.Wrap(err) } diff --git a/private/dbutil/cockroachutil/driver.go b/private/dbutil/cockroachutil/driver.go index bed643dbc..6657b06b5 100644 --- a/private/dbutil/cockroachutil/driver.go +++ b/private/dbutil/cockroachutil/driver.go @@ -7,61 +7,71 @@ import ( "context" "database/sql" "database/sql/driver" - "errors" "io" - "reflect" "strings" - "github.com/lib/pq" + "github.com/jackc/pgx/v4/stdlib" "github.com/zeebo/errs" + + "storj.io/storj/private/dbutil/pgutil" ) -// Driver is the type for the "cockroach" sql/database driver. -// It uses github.com/lib/pq under the covers because of Cockroach's -// PostgreSQL compatibility, but allows differentiation between pg and -// crdb connections. +// Driver is the type for the "cockroach" sql/database driver. It uses +// github.com/jackc/pgx/v4/stdlib under the covers because of Cockroach's +// PostgreSQL compatibility, but allows differentiation between pg and crdb +// connections. type Driver struct { - pq.Driver + pgxDriver stdlib.Driver } // Open opens a new cockroachDB connection. func (cd *Driver) Open(name string) (driver.Conn, error) { name = translateName(name) - return pq.Open(name) + conn, err := cd.pgxDriver.Open(name) + if err != nil { + return nil, err + } + pgxStdlibConn, ok := conn.(*stdlib.Conn) + if !ok { + return nil, errs.New("Conn from pgx is not a *stdlib.Conn??? T: %T", conn) + } + return &cockroachConn{pgxStdlibConn}, nil } // OpenConnector obtains a new db Connector, which sql.DB can use to // obtain each needed connection at the appropriate time. func (cd *Driver) OpenConnector(name string) (driver.Connector, error) { name = translateName(name) - pgConnector, err := pq.NewConnector(name) + pgxConnector, err := cd.pgxDriver.OpenConnector(name) if err != nil { return nil, err } - return &cockroachConnector{pgConnector}, nil + return &cockroachConnector{driver: cd, pgxConnector: pgxConnector}, nil } // cockroachConnector is a thin wrapper around a pq-based connector. This allows // Driver to supply our custom cockroachConn type for connections. type cockroachConnector struct { - pgConnector driver.Connector + driver *Driver + pgxConnector driver.Connector } // Driver returns the driver being used for this connector. func (c *cockroachConnector) Driver() driver.Driver { - return &Driver{} + return c.driver } // Connect creates a new connection using the connector. func (c *cockroachConnector) Connect(ctx context.Context) (driver.Conn, error) { - pgConn, err := c.pgConnector.Connect(ctx) + pgxConn, err := c.pgxConnector.Connect(ctx) if err != nil { return nil, err } - if pgConnAll, ok := pgConn.(connAll); ok { - return &cockroachConn{pgConnAll}, nil + pgxStdlibConn, ok := pgxConn.(*stdlib.Conn) + if !ok { + return nil, errs.New("Conn from pgx is not a *stdlib.Conn??? T: %T", pgxConn) } - return nil, errs.New("Underlying connector type %T does not implement connAll?!", pgConn) + return &cockroachConn{pgxStdlibConn}, nil } type connAll interface { @@ -73,7 +83,7 @@ type connAll interface { // cockroachConn is a connection to a database. It is not used concurrently by multiple goroutines. type cockroachConn struct { - underlying connAll + underlying *stdlib.Conn } // Assert that cockroachConn fulfills connAll. @@ -205,11 +215,8 @@ const ( ) func (c *cockroachConn) txnStatus() transactionStatus { - // access c.underlying -> c.underlying.(*pq.conn) -> (*c.underlying.(*pq.conn)).txnStatus - // - // this is of course brittle if lib/pq internals change, so a test is necessary to make - // sure we stay on the same page. - return transactionStatus(reflect.ValueOf(c.underlying).Elem().Field(4).Uint()) + pgConn := c.underlying.Conn().PgConn() + return transactionStatus(pgConn.TxStatus()) } func (c *cockroachConn) isInTransaction() bool { @@ -312,7 +319,7 @@ func (stmt *cockroachStmt) QueryContext(ctx context.Context, args []driver.Named } // translateName changes the scheme name in a `cockroach://` URL to -// `postgres://`, as that is what lib/pq will expect. +// `postgres://`, as that is what jackc/pgx will expect. func translateName(name string) string { if strings.HasPrefix(name, "cockroach://") { name = "postgres://" + name[12:] @@ -323,7 +330,7 @@ func translateName(name string) string { // NeedsRetry checks if the error code means a retry is needed, // borrowed from code in crdb. func NeedsRetry(err error) bool { - code := errCode(err) + code := pgutil.ErrorCode(err) // 57P01 occurs when a CRDB node rejoins the cluster but is not ready to accept connections // CRDB support recommended a retry at this point @@ -332,30 +339,8 @@ func NeedsRetry(err error) bool { return code == "40001" || code == "CR000" || code == "57P01" } -// borrowed from crdb -func errCode(err error) string { - switch t := errorCause(err).(type) { - case *pq.Error: - return string(t.Code) - default: - return "" - } -} - -func errorCause(err error) error { - for err != nil { - cause := errors.Unwrap(err) - if cause == nil { - break - } - err = cause - } - return err -} - -// Assert that Driver satisfies DriverContext. -var _ driver.DriverContext = &Driver{} +var defaultDriver = &Driver{} func init() { - sql.Register("cockroach", &Driver{}) + sql.Register("cockroach", defaultDriver) } diff --git a/private/dbutil/dbimplementation.go b/private/dbutil/dbimplementation.go index ff2a089d3..810f5c175 100644 --- a/private/dbutil/dbimplementation.go +++ b/private/dbutil/dbimplementation.go @@ -25,7 +25,7 @@ const ( // the url with the provided scheme. func ImplementationForScheme(scheme string) Implementation { switch scheme { - case "postgres", "postgresql": + case "pgx", "postgres", "postgresql": return Postgres case "cockroach": return Cockroach diff --git a/private/dbutil/pgutil/db.go b/private/dbutil/pgutil/db.go index 0589871f0..e70af5d6a 100644 --- a/private/dbutil/pgutil/db.go +++ b/private/dbutil/pgutil/db.go @@ -5,12 +5,16 @@ package pgutil import ( "context" + "errors" "strings" + "time" - "github.com/lib/pq" + "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4" "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" + "storj.io/common/storj" "storj.io/storj/private/dbutil" "storj.io/storj/private/dbutil/dbschema" "storj.io/storj/private/tagsql" @@ -20,6 +24,12 @@ var ( mon = monkit.Package() ) +const ( + // pgErrorClassConstraintViolation is the class of PostgreSQL errors indicating + // integrity constraint violations. + pgErrorClassConstraintViolation = "23" +) + // OpenUnique opens a postgres database with a temporary unique schema, which will be cleaned up // when closed. It is expected that this should normally be used by way of // "storj.io/storj/private/dbutil/tempdb".OpenUnique() instead of calling it directly. @@ -32,14 +42,14 @@ func OpenUnique(ctx context.Context, connstr string, schemaPrefix string) (*dbut schemaName := schemaPrefix + "-" + CreateRandomTestingSchemaName(8) connStrWithSchema := ConnstrWithSchema(connstr, schemaName) - db, err := tagsql.Open("postgres", connStrWithSchema) + db, err := tagsql.Open("pgx", connStrWithSchema) if err == nil { // check that connection actually worked before trying CreateSchema, to make // troubleshooting (lots) easier err = db.PingContext(ctx) } if err != nil { - return nil, errs.New("failed to connect to %q with driver postgres: %w", connStrWithSchema, err) + return nil, errs.New("failed to connect to %q with driver pgx: %w", connStrWithSchema, err) } err = CreateSchema(ctx, db, schemaName) @@ -56,7 +66,7 @@ func OpenUnique(ctx context.Context, connstr string, schemaPrefix string) (*dbut DB: db, ConnStr: connStrWithSchema, Schema: schemaName, - Driver: "postgres", + Driver: "pgx", Implementation: dbutil.Postgres, Cleanup: cleanup, }, nil @@ -97,12 +107,161 @@ func CheckApplicationName(s string) (r string) { // IsConstraintError checks if given error is about constraint violation func IsConstraintError(err error) bool { - return errs.IsFunc(err, func(err error) bool { - if e, ok := err.(*pq.Error); ok { - if e.Code.Class() == "23" { - return true - } - } - return false - }) + errCode := ErrorCode(err) + return strings.HasPrefix(errCode, pgErrorClassConstraintViolation) +} + +// ErrorCode returns the 5-character PostgreSQL error code string associated +// with the given error, if any. +func ErrorCode(err error) string { + var sqlStateErr errWithSQLState + if errors.As(err, &sqlStateErr) { + return sqlStateErr.SQLState() + } + return "" +} + +// errWithSQLState is an interface supported by error classes corresponding +// to PostgreSQL errors from certain drivers. This is satisfied, in particular, +// by pgx (*pgconn.PgError) and may be adopted by other types. An effort is +// apparently underway to get lib/pq to add this interface. +type errWithSQLState interface { + SQLState() string +} + +// The following XArray() helper methods exist alongside similar methods in the +// jackc/pgtype library. The difference with the methods in pgtype is that they +// will accept any of a wide range of types. That is nice, but it comes with +// the potential that someone might pass in an invalid type; thus, those +// methods have to return (*pgtype.XArray, error). +// +// The methods here do not need to return an error because they require passing +// in the correct type to begin with. +// +// An alternative implementation for the following methods might look like +// calls to pgtype.ByteaArray() followed by `if err != nil { panic }` blocks. +// That would probably be ok, but we decided on this approach, as it ought to +// require fewer allocations and less time, in addition to having no error +// return. + +// ByteaArray returns an object usable by pg drivers for passing a [][]byte slice +// into a database as type BYTEA[]. +func ByteaArray(bytesArray [][]byte) *pgtype.ByteaArray { + pgtypeByteaArray := make([]pgtype.Bytea, len(bytesArray)) + for i, byteSlice := range bytesArray { + pgtypeByteaArray[i].Bytes = byteSlice + pgtypeByteaArray[i].Status = pgtype.Present + } + return &pgtype.ByteaArray{ + Elements: pgtypeByteaArray, + Dimensions: []pgtype.ArrayDimension{{Length: int32(len(bytesArray)), LowerBound: 1}}, + Status: pgtype.Present, + } +} + +// StringArray returns an object usable by pg drivers for passing a []string slice +// into a database as type VARCHAR[]. +func StringArray(stringSlice []string) *pgtype.VarcharArray { + pgtypeVarcharArray := make([]pgtype.Varchar, len(stringSlice)) + for i, s := range stringSlice { + pgtypeVarcharArray[i].String = s + pgtypeVarcharArray[i].Status = pgtype.Present + } + return &pgtype.VarcharArray{ + Elements: pgtypeVarcharArray, + Dimensions: []pgtype.ArrayDimension{{Length: int32(len(stringSlice)), LowerBound: 1}}, + Status: pgtype.Present, + } +} + +// TimestampTZArray returns an object usable by pg drivers for passing a []time.Time +// slice into a database as type TIMESTAMPTZ[]. +func TimestampTZArray(timeSlice []time.Time) *pgtype.TimestamptzArray { + pgtypeTimestamptzArray := make([]pgtype.Timestamptz, len(timeSlice)) + for i, t := range timeSlice { + pgtypeTimestamptzArray[i].Time = t + pgtypeTimestamptzArray[i].Status = pgtype.Present + } + return &pgtype.TimestamptzArray{ + Elements: pgtypeTimestamptzArray, + Dimensions: []pgtype.ArrayDimension{{Length: int32(len(timeSlice)), LowerBound: 1}}, + Status: pgtype.Present, + } +} + +// Int4Array returns an object usable by pg drivers for passing a []int32 slice +// into a database as type INT4[]. +func Int4Array(ints []int32) *pgtype.Int4Array { + pgtypeInt4Array := make([]pgtype.Int4, len(ints)) + for i, someInt := range ints { + pgtypeInt4Array[i].Int = someInt + pgtypeInt4Array[i].Status = pgtype.Present + } + return &pgtype.Int4Array{ + Elements: pgtypeInt4Array, + Dimensions: []pgtype.ArrayDimension{{Length: int32(len(ints)), LowerBound: 1}}, + Status: pgtype.Present, + } +} + +// Int8Array returns an object usable by pg drivers for passing a []int64 slice +// into a database as type INT8[]. +func Int8Array(bigInts []int64) *pgtype.Int8Array { + pgtypeInt8Array := make([]pgtype.Int8, len(bigInts)) + for i, bigInt := range bigInts { + pgtypeInt8Array[i].Int = bigInt + pgtypeInt8Array[i].Status = pgtype.Present + } + return &pgtype.Int8Array{ + Elements: pgtypeInt8Array, + Dimensions: []pgtype.ArrayDimension{{Length: int32(len(bigInts)), LowerBound: 1}}, + Status: pgtype.Present, + } +} + +// Float8Array returns an object usable by pg drivers for passing a []float64 slice +// into a database as type FLOAT8[]. +func Float8Array(floats []float64) *pgtype.Float8Array { + pgtypeFloat8Array := make([]pgtype.Float8, len(floats)) + for i, someFloat := range floats { + pgtypeFloat8Array[i].Float = someFloat + pgtypeFloat8Array[i].Status = pgtype.Present + } + return &pgtype.Float8Array{ + Elements: pgtypeFloat8Array, + Dimensions: []pgtype.ArrayDimension{{Length: int32(len(floats)), LowerBound: 1}}, + Status: pgtype.Present, + } +} + +// NodeIDArray returns an object usable by pg drivers for passing a []storj.NodeID +// slice into a database as type BYTEA[]. +func NodeIDArray(nodeIDs []storj.NodeID) *pgtype.ByteaArray { + if nodeIDs == nil { + return &pgtype.ByteaArray{Status: pgtype.Null} + } + pgtypeByteaArray := make([]pgtype.Bytea, len(nodeIDs)) + for i, nodeID := range nodeIDs { + nodeIDCopy := nodeID + pgtypeByteaArray[i].Bytes = nodeIDCopy[:] + pgtypeByteaArray[i].Status = pgtype.Present + } + return &pgtype.ByteaArray{ + Elements: pgtypeByteaArray, + Dimensions: []pgtype.ArrayDimension{{Length: int32(len(nodeIDs)), LowerBound: 1}}, + Status: pgtype.Present, + } +} + +// QuoteIdentifier quotes an identifier for use in an interpolated SQL string. +func QuoteIdentifier(ident string) string { + return pgx.Identifier{ident}.Sanitize() +} + +// UnquoteIdentifier is the analog of QuoteIdentifier. +func UnquoteIdentifier(quotedIdent string) string { + if len(quotedIdent) >= 2 && quotedIdent[0] == '"' && quotedIdent[len(quotedIdent)-1] == '"' { + quotedIdent = strings.ReplaceAll(quotedIdent[1:len(quotedIdent)-1], "\"\"", "\"") + } + return quotedIdent } diff --git a/private/dbutil/pgutil/query.go b/private/dbutil/pgutil/query.go index 4227a752a..0751ed2d9 100644 --- a/private/dbutil/pgutil/query.go +++ b/private/dbutil/pgutil/query.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/lib/pq" + "github.com/jackc/pgtype" "github.com/zeebo/errs" "storj.io/storj/private/dbutil/dbschema" @@ -97,10 +97,15 @@ func QuerySchema(ctx context.Context, db dbschema.Queryer) (*dbschema.Schema, er for rows.Next() { var tableName, constraintName, constraintType string - var columns pq.StringArray + var columnsArray pgtype.VarcharArray + var columns []string var definition string - err := rows.Scan(&tableName, &constraintName, &constraintType, &columns, &definition) + err := rows.Scan(&tableName, &constraintName, &constraintType, &columnsArray, &definition) + if err != nil { + return err + } + err = columnsArray.AssignTo(&columns) if err != nil { return err } @@ -108,7 +113,7 @@ func QuerySchema(ctx context.Context, db dbschema.Queryer) (*dbschema.Schema, er switch constraintType { case "p": // primary key table := schema.EnsureTable(tableName) - table.PrimaryKey = ([]string)(columns) + table.PrimaryKey = columns case "f": // foreign key if len(columns) != 1 { return fmt.Errorf("expected one column, got: %q", columns) @@ -184,14 +189,6 @@ var rxPostgresForeignKey = regexp.MustCompile( `(?:\s*ON DELETE (CASCADE|RESTRICT|SET NULL|SET DEFAULT|NO ACTION))?$`, ) -// UnquoteIdentifier is the analog of pq.QuoteIdentifier. -func UnquoteIdentifier(quotedIdent string) string { - if len(quotedIdent) >= 2 && quotedIdent[0] == '"' && quotedIdent[len(quotedIdent)-1] == '"' { - quotedIdent = strings.ReplaceAll(quotedIdent[1:len(quotedIdent)-1], "\"\"", "\"") - } - return quotedIdent -} - var ( rxIndex = regexp.MustCompile(`^CREATE( UNIQUE)? INDEX (.*) ON .*\.(.*) USING btree \((.*)\)$`) indexDirRemove = strings.NewReplacer(" ASC", "", " DESC", "") diff --git a/private/dbutil/pgutil/query_test.go b/private/dbutil/pgutil/query_test.go index 108822251..17b292b2d 100644 --- a/private/dbutil/pgutil/query_test.go +++ b/private/dbutil/pgutil/query_test.go @@ -6,7 +6,7 @@ package pgutil_test import ( "testing" - _ "github.com/lib/pq" + _ "github.com/jackc/pgx/v4/stdlib" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/private/dbutil/pgutil/schema.go b/private/dbutil/pgutil/schema.go index e360af9b8..f6eb191f4 100644 --- a/private/dbutil/pgutil/schema.go +++ b/private/dbutil/pgutil/schema.go @@ -11,8 +11,6 @@ import ( "encoding/hex" "net/url" "strings" - - "github.com/lib/pq" ) // CreateRandomTestingSchemaName creates a random schema name string. @@ -32,7 +30,7 @@ func ConnstrWithSchema(connstr, schema string) string { } else { connstr += "?options=" } - return connstr + url.QueryEscape("--search_path="+pq.QuoteIdentifier(schema)) + return connstr + url.QueryEscape("--search_path="+QuoteIdentifier(schema)) } // ParseSchemaFromConnstr returns the name of the schema parsed from the @@ -43,7 +41,7 @@ func ParseSchemaFromConnstr(connstr string) (string, error) { return "", err } queryValues := url.Query() - // this is the Properâ„¢ way to encode search_path in a pq connection string + // this is the Properâ„¢ way to encode search_path in a pg connection string options := queryValues["options"] for _, option := range options { if strings.HasPrefix(option, "--search_path=") { @@ -60,7 +58,7 @@ func ParseSchemaFromConnstr(connstr string) (string, error) { // QuoteSchema quotes schema name for func QuoteSchema(schema string) string { - return pq.QuoteIdentifier(schema) + return QuoteIdentifier(schema) } // Execer is for executing sql diff --git a/satellite/satellitedb/utils_test.go b/private/dbutil/pgutil/utils_test.go similarity index 64% rename from satellite/satellitedb/utils_test.go rename to private/dbutil/pgutil/utils_test.go index e945ca4f0..393b212cd 100644 --- a/satellite/satellitedb/utils_test.go +++ b/private/dbutil/pgutil/utils_test.go @@ -1,12 +1,11 @@ // Copyright (C) 2019 Storj Labs, Inc. // See LICENSE for copying information. -package satellitedb +package pgutil import ( "testing" - "github.com/lib/pq" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -20,11 +19,11 @@ func TestPostgresNodeIDsArray(t *testing.T) { ids[i] = testrand.NodeID() } - got, err := postgresNodeIDList(ids).Value() // returns a []byte + got, err := NodeIDArray(ids).Value() // returns a string require.NoError(t, err) - expected, err := pq.ByteaArray(ids.Bytes()).Value() // returns a string + expected, err := ByteaArray(ids.Bytes()).Value() // returns a string require.NoError(t, err) - assert.Equal(t, expected.(string), string(got.([]byte))) + assert.Equal(t, expected.(string), got.(string)) } diff --git a/private/dbutil/split.go b/private/dbutil/split.go index 337eb61ec..04ae13e86 100644 --- a/private/dbutil/split.go +++ b/private/dbutil/split.go @@ -19,8 +19,13 @@ func SplitConnStr(s string) (driver string, source string, implementation Implem source = parts[1] implementation = ImplementationForScheme(parts[0]) - if implementation == Postgres || implementation == Cockroach { - source = s // postgres and cockroach want full URLS for their DSNs + switch implementation { + case Postgres: + source = s // postgres wants full URLS for its DSN + driver = "pgx" + case Cockroach: + source = s // cockroach wants full URLS for its DSN + driver = "pgxcockroach" } return driver, source, implementation, nil } diff --git a/private/dbutil/sqliteutil/query_test.go b/private/dbutil/sqliteutil/query_test.go index 016e50294..17b602385 100644 --- a/private/dbutil/sqliteutil/query_test.go +++ b/private/dbutil/sqliteutil/query_test.go @@ -6,7 +6,7 @@ package sqliteutil_test import ( "testing" - _ "github.com/lib/pq" + _ "github.com/jackc/pgx/v4/stdlib" _ "github.com/mattn/go-sqlite3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/private/dbutil/txutil/transactions.go b/private/dbutil/txutil/transactions.go index fd08a15c3..2a9206d15 100644 --- a/private/dbutil/txutil/transactions.go +++ b/private/dbutil/txutil/transactions.go @@ -10,10 +10,10 @@ import ( "database/sql" "time" - "github.com/lib/pq" "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/private/tagsql" ) @@ -40,7 +40,7 @@ func WithTx(ctx context.Context, db tagsql.DB, txOpts *sql.TxOptions, fn func(co if dur := time.Since(start); dur < 5*time.Minute && i < 10 { // even though the resources (duration and count) allow us to issue a retry, // we only should if the error claims we should. - if code := errCode(err); code == "CR000" || code == "40001" { + if code := pgutil.ErrorCode(err); code == "CR000" || code == "40001" { continue } } else { @@ -74,16 +74,3 @@ func withTxOnce(ctx context.Context, db tagsql.DB, txOpts *sql.TxOptions, fn fun return fn(ctx, tx), nil } - -// errCode returns the error code associated with any postgres error in the chain of -// errors walked by unwrapping. -func errCode(err error) (code string) { - errs.IsFunc(err, func(err error) bool { - if pgerr, ok := err.(*pq.Error); ok { - code = string(pgerr.Code) - return true - } - return false - }) - return code -} diff --git a/private/migrate/create_test.go b/private/migrate/create_test.go index 75a3b81d7..955aeda92 100644 --- a/private/migrate/create_test.go +++ b/private/migrate/create_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - _ "github.com/lib/pq" + _ "github.com/jackc/pgx/v4/stdlib" _ "github.com/mattn/go-sqlite3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/private/migrate/versions_test.go b/private/migrate/versions_test.go index 4800b59d1..647277c88 100644 --- a/private/migrate/versions_test.go +++ b/private/migrate/versions_test.go @@ -147,7 +147,7 @@ func TestMultipleMigrationSqlite(t *testing.T) { func TestMultipleMigrationPostgres(t *testing.T) { connstr := pgtest.PickPostgres(t) - db, err := tagsql.Open("postgres", connstr) + db, err := tagsql.Open("pgx", connstr) require.NoError(t, err) defer func() { assert.NoError(t, db.Close()) }() @@ -223,7 +223,7 @@ func TestFailedMigrationSqlite(t *testing.T) { func TestFailedMigrationPostgres(t *testing.T) { connstr := pgtest.PickPostgres(t) - db, err := tagsql.Open("postgres", connstr) + db, err := tagsql.Open("pgx", connstr) require.NoError(t, err) defer func() { assert.NoError(t, db.Close()) }() diff --git a/private/tagsql/db_test.go b/private/tagsql/db_test.go index 78fff3e6e..bc87d6e34 100644 --- a/private/tagsql/db_test.go +++ b/private/tagsql/db_test.go @@ -6,7 +6,7 @@ package tagsql_test import ( "testing" - _ "github.com/lib/pq" + _ "github.com/jackc/pgx/v4/stdlib" _ "github.com/mattn/go-sqlite3" "github.com/stretchr/testify/require" @@ -33,7 +33,7 @@ func run(t *testing.T, fn func(*testcontext.Context, *testing.T, tagsql.DB, tags fn(ctx, t, db, tagsql.SupportBasic) }) - t.Run("lib-pq-postgres", func(t *testing.T) { + t.Run("jackc-pgx-postgres", func(t *testing.T) { connstr := pgtest.PickPostgres(t) ctx := testcontext.New(t) @@ -49,7 +49,7 @@ func run(t *testing.T, fn func(*testcontext.Context, *testing.T, tagsql.DB, tags fn(ctx, t, db.DB, tagsql.SupportNone) }) - t.Run("lib-pq-cockroach", func(t *testing.T) { + t.Run("jackc-pgx-cockroach", func(t *testing.T) { connstr := pgtest.PickCockroach(t) ctx := testcontext.New(t) diff --git a/private/tagsql/detect.go b/private/tagsql/detect.go index ec2706691..6b04afdfb 100644 --- a/private/tagsql/detect.go +++ b/private/tagsql/detect.go @@ -22,7 +22,8 @@ import ( // except in transactions. For them, we need to disable. // https://github.com/mattn/go-sqlite3/issues/769 // -// Currently we don't have data on whether github.com/jackc/pgx supports them properly. +// So far, we believe that github.com/jackc/pgx supports contexts +// and cancellations properly. // ContextSupport returns the level of context support a driver has. type ContextSupport byte @@ -64,6 +65,8 @@ func DetectContextSupport(db *sql.DB) (ContextSupport, error) { // internally uses lib/pq typ.PkgPath() == "storj.io/storj/private/dbutil/cockroachutil" && typ.Name() == "Driver": return SupportNone, nil + case typ.PkgPath() == "github.com/jackc/pgx/v4/stdlib" && typ.Name() == "Driver": + return SupportTransactions, nil default: return SupportNone, errs.New("sql driver %q %q unsupported", typ.PkgPath(), typ.Name()) } diff --git a/satellite/payments/stripecoinpayments/coupons_test.go b/satellite/payments/stripecoinpayments/coupons_test.go index 2680a382b..d4c21a7b1 100644 --- a/satellite/payments/stripecoinpayments/coupons_test.go +++ b/satellite/payments/stripecoinpayments/coupons_test.go @@ -75,7 +75,7 @@ func TestCouponRepository(t *testing.T) { date, err := couponsRepo.GetLatest(ctx, coupon.ID) require.NoError(t, err) // go and postgres has different precision. go - nanoseconds, postgres micro - require.Equal(t, date.UTC(), now.Round(time.Microsecond)) + require.Equal(t, date.UTC(), now.Truncate(time.Microsecond)) }) t.Run("total usage", func(t *testing.T) { diff --git a/satellite/repair/repair_test.go b/satellite/repair/repair_test.go index 71d88e765..c4c2f6298 100644 --- a/satellite/repair/repair_test.go +++ b/satellite/repair/repair_test.go @@ -1289,6 +1289,7 @@ func testRepairGracefullyExited(t *testing.T, inMemoryRepair bool) { metainfo := satellite.Metainfo.Service listResponse, _, err := metainfo.List(ctx, "", "", true, 0, 0) require.NoError(t, err) + require.NotNil(t, listResponse) var path string var pointer *pb.Pointer diff --git a/satellite/rewards/rewards_test.go b/satellite/rewards/rewards_test.go index 1d86d745e..af13e4d9a 100644 --- a/satellite/rewards/rewards_test.go +++ b/satellite/rewards/rewards_test.go @@ -63,8 +63,8 @@ func TestOffer_Database(t *testing.T) { for i := range validOffers { new, err := planet.Satellites[0].DB.Rewards().Create(ctx, &validOffers[i]) require.NoError(t, err) - new.ExpiresAt = new.ExpiresAt.Round(time.Microsecond) - new.CreatedAt = new.CreatedAt.Round(time.Microsecond) + new.ExpiresAt = new.ExpiresAt.Truncate(time.Microsecond) + new.CreatedAt = new.CreatedAt.Truncate(time.Microsecond) all, err := planet.Satellites[0].DB.Rewards().ListAll(ctx) require.NoError(t, err) diff --git a/satellite/satellitedb/coupons.go b/satellite/satellitedb/coupons.go index 1cf76b3d4..9911ec035 100644 --- a/satellite/satellitedb/coupons.go +++ b/satellite/satellitedb/coupons.go @@ -10,11 +10,11 @@ import ( "sort" "time" - "github.com/lib/pq" "github.com/zeebo/errs" "storj.io/common/memory" "storj.io/common/uuid" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/satellite/console" "storj.io/storj/satellite/payments" "storj.io/storj/satellite/payments/coinpayments" @@ -435,7 +435,7 @@ func (coupons *coupons) activeUserWithProjectAndWithoutCoupon(ctx context.Contex WHERE users_with_projects.id NOT IN ( SELECT user_id FROM coupons WHERE type = ? ) - `), pq.ByteaArray(userIDs), console.Active, payments.CouponTypePromotional) + `), pgutil.ByteaArray(userIDs), console.Active, payments.CouponTypePromotional) if err != nil { return nil, err } diff --git a/satellite/satellitedb/dbx/gen.sh b/satellite/satellitedb/dbx/gen.sh index 3d42236b6..463a0502b 100644 --- a/satellite/satellitedb/dbx/gen.sh +++ b/satellite/satellitedb/dbx/gen.sh @@ -1,12 +1,12 @@ #!/bin/sh -dbx schema -d postgres -d cockroach satellitedb.dbx . -dbx golang -d postgres -d cockroach -p dbx -t templates satellitedb.dbx . +dbx schema -d pgx -d pgxcockroach satellitedb.dbx . +dbx golang -d pgx -d pgxcockroach -p dbx -t templates satellitedb.dbx . ( echo '//lint:file-ignore * generated file'; cat satellitedb.dbx.go ) > satellitedb.dbx.go.tmp && mv satellitedb.dbx.go.tmp satellitedb.dbx.go gofmt -r "*sql.Tx -> tagsql.Tx" -w satellitedb.dbx.go gofmt -r "*sql.Rows -> tagsql.Rows" -w satellitedb.dbx.go perl -0777 -pi \ - -e 's,\t"github.com/lib/pq"\n\),\t"github.com/lib/pq"\n\n\t"storj.io/storj/private/tagsql"\n\),' \ + -e 's,\t_ "github.com/jackc/pgx/v4/stdlib"\n\),\t_ "github.com/jackc/pgx/v4/stdlib"\n\n\t"storj.io/storj/private/tagsql"\n\),' \ satellitedb.dbx.go perl -0777 -pi \ -e 's/type DB struct \{\n\t\*sql\.DB/type DB struct \{\n\ttagsql.DB/' \ diff --git a/satellite/satellitedb/dbx/satellitedb.dbx.go b/satellite/satellitedb/dbx/satellitedb.dbx.go index 9a1ac53ed..4e202fee1 100644 --- a/satellite/satellitedb/dbx/satellitedb.dbx.go +++ b/satellite/satellitedb/dbx/satellitedb.dbx.go @@ -1,5 +1,4 @@ //lint:file-ignore * generated file -//lint:file-ignore * generated file // AUTOGENERATED BY storj.io/dbx // DO NOT EDIT. @@ -18,7 +17,8 @@ import ( "time" "unicode" - "github.com/lib/pq" + "github.com/jackc/pgconn" + _ "github.com/jackc/pgx/v4/stdlib" "storj.io/storj/private/tagsql" ) @@ -143,10 +143,10 @@ type DB struct { func Open(driver, source string) (db *DB, err error) { var sql_db *sql.DB switch driver { - case "postgres": - sql_db, err = openpostgres(source) - case "cockroach": - sql_db, err = opencockroach(source) + case "pgx": + sql_db, err = openpgx(source) + case "pgxcockroach": + sql_db, err = openpgxcockroach(source) default: return nil, unsupportedDriver(driver) } @@ -169,10 +169,10 @@ func Open(driver, source string) (db *DB, err error) { db.Hooks.Now = time.Now switch driver { - case "postgres": - db.dbMethods = newpostgres(db) - case "cockroach": - db.dbMethods = newcockroach(db) + case "pgx": + db.dbMethods = newpgx(db) + case "pgxcockroach": + db.dbMethods = newpgxcockroach(db) default: return nil, unsupportedDriver(driver) } @@ -235,21 +235,21 @@ func (tx *dialectTx) Rollback() (err error) { return makeErr(tx.tx.Rollback()) } -type postgresImpl struct { +type pgxImpl struct { db *DB - dialect __sqlbundle_postgres + dialect __sqlbundle_pgx driver driver } -func (obj *postgresImpl) Rebind(s string) string { +func (obj *pgxImpl) Rebind(s string) string { return obj.dialect.Rebind(s) } -func (obj *postgresImpl) logStmt(stmt string, args ...interface{}) { - postgresLogStmt(stmt, args...) +func (obj *pgxImpl) logStmt(stmt string, args ...interface{}) { + pgxLogStmt(stmt, args...) } -func (obj *postgresImpl) makeErr(err error) error { +func (obj *pgxImpl) makeErr(err error) error { constraint, ok := obj.isConstraintError(err) if ok { return constraintViolation(err, constraint) @@ -257,22 +257,22 @@ func (obj *postgresImpl) makeErr(err error) error { return makeErr(err) } -type postgresDB struct { +type pgxDB struct { db *DB - *postgresImpl + *pgxImpl } -func newpostgres(db *DB) *postgresDB { - return &postgresDB{ +func newpgx(db *DB) *pgxDB { + return &pgxDB{ db: db, - postgresImpl: &postgresImpl{ + pgxImpl: &pgxImpl{ db: db, driver: db.DB, }, } } -func (obj *postgresDB) Schema() string { +func (obj *pgxDB) Schema() string { return `CREATE TABLE accounting_rollups ( id bigserial NOT NULL, node_id bytea NOT NULL, @@ -743,22 +743,22 @@ CREATE INDEX storagenode_storage_tallies_node_id_index ON storagenode_storage_ta CREATE UNIQUE INDEX credits_earned_user_id_offer_id ON user_credits ( id, offer_id );` } -func (obj *postgresDB) wrapTx(tx tagsql.Tx) txMethods { - return &postgresTx{ +func (obj *pgxDB) wrapTx(tx tagsql.Tx) txMethods { + return &pgxTx{ dialectTx: dialectTx{tx: tx}, - postgresImpl: &postgresImpl{ + pgxImpl: &pgxImpl{ db: obj.db, driver: tx, }, } } -type postgresTx struct { +type pgxTx struct { dialectTx - *postgresImpl + *pgxImpl } -func postgresLogStmt(stmt string, args ...interface{}) { +func pgxLogStmt(stmt string, args ...interface{}) { // TODO: render placeholders if Logger != nil { out := fmt.Sprintf("stmt: %s\nargs: %v\n", stmt, pretty(args)) @@ -766,21 +766,21 @@ func postgresLogStmt(stmt string, args ...interface{}) { } } -type cockroachImpl struct { +type pgxcockroachImpl struct { db *DB - dialect __sqlbundle_cockroach + dialect __sqlbundle_pgxcockroach driver driver } -func (obj *cockroachImpl) Rebind(s string) string { +func (obj *pgxcockroachImpl) Rebind(s string) string { return obj.dialect.Rebind(s) } -func (obj *cockroachImpl) logStmt(stmt string, args ...interface{}) { - cockroachLogStmt(stmt, args...) +func (obj *pgxcockroachImpl) logStmt(stmt string, args ...interface{}) { + pgxcockroachLogStmt(stmt, args...) } -func (obj *cockroachImpl) makeErr(err error) error { +func (obj *pgxcockroachImpl) makeErr(err error) error { constraint, ok := obj.isConstraintError(err) if ok { return constraintViolation(err, constraint) @@ -788,22 +788,22 @@ func (obj *cockroachImpl) makeErr(err error) error { return makeErr(err) } -type cockroachDB struct { +type pgxcockroachDB struct { db *DB - *cockroachImpl + *pgxcockroachImpl } -func newcockroach(db *DB) *cockroachDB { - return &cockroachDB{ +func newpgxcockroach(db *DB) *pgxcockroachDB { + return &pgxcockroachDB{ db: db, - cockroachImpl: &cockroachImpl{ + pgxcockroachImpl: &pgxcockroachImpl{ db: db, driver: db.DB, }, } } -func (obj *cockroachDB) Schema() string { +func (obj *pgxcockroachDB) Schema() string { return `CREATE TABLE accounting_rollups ( id bigserial NOT NULL, node_id bytea NOT NULL, @@ -1274,22 +1274,22 @@ CREATE INDEX storagenode_storage_tallies_node_id_index ON storagenode_storage_ta CREATE UNIQUE INDEX credits_earned_user_id_offer_id ON user_credits ( id, offer_id );` } -func (obj *cockroachDB) wrapTx(tx tagsql.Tx) txMethods { - return &cockroachTx{ +func (obj *pgxcockroachDB) wrapTx(tx tagsql.Tx) txMethods { + return &pgxcockroachTx{ dialectTx: dialectTx{tx: tx}, - cockroachImpl: &cockroachImpl{ + pgxcockroachImpl: &pgxcockroachImpl{ db: obj.db, driver: tx, }, } } -type cockroachTx struct { +type pgxcockroachTx struct { dialectTx - *cockroachImpl + *pgxcockroachImpl } -func cockroachLogStmt(stmt string, args ...interface{}) { +func pgxcockroachLogStmt(stmt string, args ...interface{}) { // TODO: render placeholders if Logger != nil { out := fmt.Sprintf("stmt: %s\nargs: %v\n", stmt, pretty(args)) @@ -9012,7 +9012,7 @@ type Value_Row struct { Value time.Time } -func (obj *postgresImpl) Create_ValueAttribution(ctx context.Context, +func (obj *pgxImpl) Create_ValueAttribution(ctx context.Context, value_attribution_project_id ValueAttribution_ProjectId_Field, value_attribution_bucket_name ValueAttribution_BucketName_Field, value_attribution_partner_id ValueAttribution_PartnerId_Field) ( @@ -9042,7 +9042,7 @@ func (obj *postgresImpl) Create_ValueAttribution(ctx context.Context, } -func (obj *postgresImpl) Create_PendingAudits(ctx context.Context, +func (obj *pgxImpl) Create_PendingAudits(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field, pending_audits_piece_id PendingAudits_PieceId_Field, pending_audits_stripe_index PendingAudits_StripeIndex_Field, @@ -9077,7 +9077,7 @@ func (obj *postgresImpl) Create_PendingAudits(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_Irreparabledb(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_Irreparabledb(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field, irreparabledb_segmentdetail Irreparabledb_Segmentdetail_Field, irreparabledb_pieces_lost_count Irreparabledb_PiecesLostCount_Field, @@ -9107,7 +9107,7 @@ func (obj *postgresImpl) CreateNoReturn_Irreparabledb(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_AccountingTimestamps(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_AccountingTimestamps(ctx context.Context, accounting_timestamps_name AccountingTimestamps_Name_Field, accounting_timestamps_value AccountingTimestamps_Value_Field) ( err error) { @@ -9131,7 +9131,7 @@ func (obj *postgresImpl) CreateNoReturn_AccountingTimestamps(ctx context.Context } -func (obj *postgresImpl) CreateNoReturn_AccountingRollup(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_AccountingRollup(ctx context.Context, accounting_rollup_node_id AccountingRollup_NodeId_Field, accounting_rollup_start_time AccountingRollup_StartTime_Field, accounting_rollup_put_total AccountingRollup_PutTotal_Field, @@ -9167,7 +9167,7 @@ func (obj *postgresImpl) CreateNoReturn_AccountingRollup(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_Node(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_Node(ctx context.Context, node_id Node_Id_Field, node_last_net Node_LastNet_Field, node_email Node_Email_Field, @@ -9363,7 +9363,7 @@ func (obj *postgresImpl) CreateNoReturn_Node(ctx context.Context, } -func (obj *postgresImpl) Create_AuditHistory(ctx context.Context, +func (obj *pgxImpl) Create_AuditHistory(ctx context.Context, audit_history_node_id AuditHistory_NodeId_Field, audit_history_history AuditHistory_History_Field) ( audit_history *AuditHistory, err error) { @@ -9388,7 +9388,7 @@ func (obj *postgresImpl) Create_AuditHistory(ctx context.Context, } -func (obj *postgresImpl) Create_User(ctx context.Context, +func (obj *pgxImpl) Create_User(ctx context.Context, user_id User_Id_Field, user_email User_Email_Field, user_normalized_email User_NormalizedEmail_Field, @@ -9426,7 +9426,7 @@ func (obj *postgresImpl) Create_User(ctx context.Context, } -func (obj *postgresImpl) Create_Project(ctx context.Context, +func (obj *pgxImpl) Create_Project(ctx context.Context, project_id Project_Id_Field, project_name Project_Name_Field, project_description Project_Description_Field, @@ -9488,7 +9488,7 @@ func (obj *postgresImpl) Create_Project(ctx context.Context, } -func (obj *postgresImpl) Create_ProjectInvoiceStamp(ctx context.Context, +func (obj *pgxImpl) Create_ProjectInvoiceStamp(ctx context.Context, project_invoice_stamp_project_id ProjectInvoiceStamp_ProjectId_Field, project_invoice_stamp_invoice_id ProjectInvoiceStamp_InvoiceId_Field, project_invoice_stamp_start_date ProjectInvoiceStamp_StartDate_Field, @@ -9519,7 +9519,7 @@ func (obj *postgresImpl) Create_ProjectInvoiceStamp(ctx context.Context, } -func (obj *postgresImpl) Create_ProjectMember(ctx context.Context, +func (obj *pgxImpl) Create_ProjectMember(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field, project_member_project_id ProjectMember_ProjectId_Field) ( project_member *ProjectMember, err error) { @@ -9547,7 +9547,7 @@ func (obj *postgresImpl) Create_ProjectMember(ctx context.Context, } -func (obj *postgresImpl) Create_ApiKey(ctx context.Context, +func (obj *pgxImpl) Create_ApiKey(ctx context.Context, api_key_id ApiKey_Id_Field, api_key_project_id ApiKey_ProjectId_Field, api_key_head ApiKey_Head_Field, @@ -9583,7 +9583,7 @@ func (obj *postgresImpl) Create_ApiKey(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_SerialNumber(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_SerialNumber(ctx context.Context, serial_number_serial_number SerialNumber_SerialNumber_Field, serial_number_bucket_id SerialNumber_BucketId_Field, serial_number_expires_at SerialNumber_ExpiresAt_Field) ( @@ -9609,7 +9609,7 @@ func (obj *postgresImpl) CreateNoReturn_SerialNumber(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_UsedSerial(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_UsedSerial(ctx context.Context, used_serial_serial_number_id UsedSerial_SerialNumberId_Field, used_serial_storage_node_id UsedSerial_StorageNodeId_Field) ( err error) { @@ -9633,7 +9633,7 @@ func (obj *postgresImpl) CreateNoReturn_UsedSerial(ctx context.Context, } -func (obj *postgresImpl) ReplaceNoReturn_PendingSerialQueue(ctx context.Context, +func (obj *pgxImpl) ReplaceNoReturn_PendingSerialQueue(ctx context.Context, pending_serial_queue_storage_node_id PendingSerialQueue_StorageNodeId_Field, pending_serial_queue_bucket_id PendingSerialQueue_BucketId_Field, pending_serial_queue_serial_number PendingSerialQueue_SerialNumber_Field, @@ -9665,7 +9665,7 @@ func (obj *postgresImpl) ReplaceNoReturn_PendingSerialQueue(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_ConsumedSerial(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_ConsumedSerial(ctx context.Context, consumed_serial_storage_node_id ConsumedSerial_StorageNodeId_Field, consumed_serial_serial_number ConsumedSerial_SerialNumber_Field, consumed_serial_expires_at ConsumedSerial_ExpiresAt_Field) ( @@ -9691,7 +9691,7 @@ func (obj *postgresImpl) CreateNoReturn_ConsumedSerial(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_Revocation(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_Revocation(ctx context.Context, revocation_revoked Revocation_Revoked_Field, revocation_api_key_id Revocation_ApiKeyId_Field) ( err error) { @@ -9715,7 +9715,7 @@ func (obj *postgresImpl) CreateNoReturn_Revocation(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_BucketStorageTally(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_BucketStorageTally(ctx context.Context, bucket_storage_tally_bucket_name BucketStorageTally_BucketName_Field, bucket_storage_tally_project_id BucketStorageTally_ProjectId_Field, bucket_storage_tally_interval_start BucketStorageTally_IntervalStart_Field, @@ -9753,7 +9753,7 @@ func (obj *postgresImpl) CreateNoReturn_BucketStorageTally(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_StoragenodePaystub(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_StoragenodePaystub(ctx context.Context, storagenode_paystub_period StoragenodePaystub_Period_Field, storagenode_paystub_node_id StoragenodePaystub_NodeId_Field, storagenode_paystub_codes StoragenodePaystub_Codes_Field, @@ -9816,7 +9816,7 @@ func (obj *postgresImpl) CreateNoReturn_StoragenodePaystub(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_StoragenodePayment(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_StoragenodePayment(ctx context.Context, storagenode_payment_node_id StoragenodePayment_NodeId_Field, storagenode_payment_period StoragenodePayment_Period_Field, storagenode_payment_amount StoragenodePayment_Amount_Field, @@ -9848,7 +9848,7 @@ func (obj *postgresImpl) CreateNoReturn_StoragenodePayment(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_PeerIdentity(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_PeerIdentity(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field, peer_identity_leaf_serial_number PeerIdentity_LeafSerialNumber_Field, peer_identity_chain PeerIdentity_Chain_Field) ( @@ -9877,7 +9877,7 @@ func (obj *postgresImpl) CreateNoReturn_PeerIdentity(ctx context.Context, } -func (obj *postgresImpl) Create_RegistrationToken(ctx context.Context, +func (obj *pgxImpl) Create_RegistrationToken(ctx context.Context, registration_token_secret RegistrationToken_Secret_Field, registration_token_project_limit RegistrationToken_ProjectLimit_Field, optional RegistrationToken_Create_Fields) ( @@ -9907,7 +9907,7 @@ func (obj *postgresImpl) Create_RegistrationToken(ctx context.Context, } -func (obj *postgresImpl) Create_ResetPasswordToken(ctx context.Context, +func (obj *pgxImpl) Create_ResetPasswordToken(ctx context.Context, reset_password_token_secret ResetPasswordToken_Secret_Field, reset_password_token_owner_id ResetPasswordToken_OwnerId_Field) ( reset_password_token *ResetPasswordToken, err error) { @@ -9935,7 +9935,7 @@ func (obj *postgresImpl) Create_ResetPasswordToken(ctx context.Context, } -func (obj *postgresImpl) Create_Offer(ctx context.Context, +func (obj *pgxImpl) Create_Offer(ctx context.Context, offer_name Offer_Name_Field, offer_description Offer_Description_Field, offer_expires_at Offer_ExpiresAt_Field, @@ -10000,7 +10000,7 @@ func (obj *postgresImpl) Create_Offer(ctx context.Context, } -func (obj *postgresImpl) Create_UserCredit(ctx context.Context, +func (obj *pgxImpl) Create_UserCredit(ctx context.Context, user_credit_user_id UserCredit_UserId_Field, user_credit_offer_id UserCredit_OfferId_Field, user_credit_type UserCredit_Type_Field, @@ -10037,7 +10037,7 @@ func (obj *postgresImpl) Create_UserCredit(ctx context.Context, } -func (obj *postgresImpl) Create_BucketMetainfo(ctx context.Context, +func (obj *pgxImpl) Create_BucketMetainfo(ctx context.Context, bucket_metainfo_id BucketMetainfo_Id_Field, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field, @@ -10089,7 +10089,7 @@ func (obj *postgresImpl) Create_BucketMetainfo(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_GracefulExitProgress(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_GracefulExitProgress(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field, graceful_exit_progress_bytes_transferred GracefulExitProgress_BytesTransferred_Field) ( err error) { @@ -10120,7 +10120,7 @@ func (obj *postgresImpl) CreateNoReturn_GracefulExitProgress(ctx context.Context } -func (obj *postgresImpl) CreateNoReturn_GracefulExitTransferQueue(ctx context.Context, +func (obj *pgxImpl) CreateNoReturn_GracefulExitTransferQueue(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field, @@ -10179,7 +10179,7 @@ func (obj *postgresImpl) CreateNoReturn_GracefulExitTransferQueue(ctx context.Co } -func (obj *postgresImpl) Create_NodesOfflineTime(ctx context.Context, +func (obj *pgxImpl) Create_NodesOfflineTime(ctx context.Context, nodes_offline_time_node_id NodesOfflineTime_NodeId_Field, nodes_offline_time_tracked_at NodesOfflineTime_TrackedAt_Field, nodes_offline_time_seconds NodesOfflineTime_Seconds_Field) ( @@ -10206,7 +10206,7 @@ func (obj *postgresImpl) Create_NodesOfflineTime(ctx context.Context, } -func (obj *postgresImpl) Create_StripeCustomer(ctx context.Context, +func (obj *pgxImpl) Create_StripeCustomer(ctx context.Context, stripe_customer_user_id StripeCustomer_UserId_Field, stripe_customer_customer_id StripeCustomer_CustomerId_Field) ( stripe_customer *StripeCustomer, err error) { @@ -10234,7 +10234,7 @@ func (obj *postgresImpl) Create_StripeCustomer(ctx context.Context, } -func (obj *postgresImpl) Create_CoinpaymentsTransaction(ctx context.Context, +func (obj *pgxImpl) Create_CoinpaymentsTransaction(ctx context.Context, coinpayments_transaction_id CoinpaymentsTransaction_Id_Field, coinpayments_transaction_user_id CoinpaymentsTransaction_UserId_Field, coinpayments_transaction_address CoinpaymentsTransaction_Address_Field, @@ -10274,7 +10274,7 @@ func (obj *postgresImpl) Create_CoinpaymentsTransaction(ctx context.Context, } -func (obj *postgresImpl) Create_StripecoinpaymentsApplyBalanceIntent(ctx context.Context, +func (obj *pgxImpl) Create_StripecoinpaymentsApplyBalanceIntent(ctx context.Context, stripecoinpayments_apply_balance_intent_tx_id StripecoinpaymentsApplyBalanceIntent_TxId_Field, stripecoinpayments_apply_balance_intent_state StripecoinpaymentsApplyBalanceIntent_State_Field) ( stripecoinpayments_apply_balance_intent *StripecoinpaymentsApplyBalanceIntent, err error) { @@ -10302,7 +10302,7 @@ func (obj *postgresImpl) Create_StripecoinpaymentsApplyBalanceIntent(ctx context } -func (obj *postgresImpl) Create_StripecoinpaymentsInvoiceProjectRecord(ctx context.Context, +func (obj *pgxImpl) Create_StripecoinpaymentsInvoiceProjectRecord(ctx context.Context, stripecoinpayments_invoice_project_record_id StripecoinpaymentsInvoiceProjectRecord_Id_Field, stripecoinpayments_invoice_project_record_project_id StripecoinpaymentsInvoiceProjectRecord_ProjectId_Field, stripecoinpayments_invoice_project_record_storage StripecoinpaymentsInvoiceProjectRecord_Storage_Field, @@ -10342,7 +10342,7 @@ func (obj *postgresImpl) Create_StripecoinpaymentsInvoiceProjectRecord(ctx conte } -func (obj *postgresImpl) Create_StripecoinpaymentsTxConversionRate(ctx context.Context, +func (obj *pgxImpl) Create_StripecoinpaymentsTxConversionRate(ctx context.Context, stripecoinpayments_tx_conversion_rate_tx_id StripecoinpaymentsTxConversionRate_TxId_Field, stripecoinpayments_tx_conversion_rate_rate StripecoinpaymentsTxConversionRate_Rate_Field) ( stripecoinpayments_tx_conversion_rate *StripecoinpaymentsTxConversionRate, err error) { @@ -10370,7 +10370,7 @@ func (obj *postgresImpl) Create_StripecoinpaymentsTxConversionRate(ctx context.C } -func (obj *postgresImpl) Create_Coupon(ctx context.Context, +func (obj *pgxImpl) Create_Coupon(ctx context.Context, coupon_id Coupon_Id_Field, coupon_user_id Coupon_UserId_Field, coupon_amount Coupon_Amount_Field, @@ -10408,7 +10408,7 @@ func (obj *postgresImpl) Create_Coupon(ctx context.Context, } -func (obj *postgresImpl) Create_CouponUsage(ctx context.Context, +func (obj *pgxImpl) Create_CouponUsage(ctx context.Context, coupon_usage_coupon_id CouponUsage_CouponId_Field, coupon_usage_amount CouponUsage_Amount_Field, coupon_usage_status CouponUsage_Status_Field, @@ -10437,7 +10437,7 @@ func (obj *postgresImpl) Create_CouponUsage(ctx context.Context, } -func (obj *postgresImpl) Create_Credit(ctx context.Context, +func (obj *pgxImpl) Create_Credit(ctx context.Context, credit_user_id Credit_UserId_Field, credit_transaction_id Credit_TransactionId_Field, credit_amount Credit_Amount_Field) ( @@ -10467,7 +10467,7 @@ func (obj *postgresImpl) Create_Credit(ctx context.Context, } -func (obj *postgresImpl) Create_CreditsSpending(ctx context.Context, +func (obj *pgxImpl) Create_CreditsSpending(ctx context.Context, credits_spending_id CreditsSpending_Id_Field, credits_spending_user_id CreditsSpending_UserId_Field, credits_spending_project_id CreditsSpending_ProjectId_Field, @@ -10503,7 +10503,7 @@ func (obj *postgresImpl) Create_CreditsSpending(ctx context.Context, } -func (obj *postgresImpl) CreateNoReturn_NodeApiVersion(ctx context.Context, +func (obj *pgxImpl) ReplaceNoReturn_NodeApiVersion(ctx context.Context, node_api_version_id NodeApiVersion_Id_Field, node_api_version_api_version NodeApiVersion_ApiVersion_Field) ( err error) { @@ -10515,7 +10515,7 @@ func (obj *postgresImpl) CreateNoReturn_NodeApiVersion(ctx context.Context, __created_at_val := __now __updated_at_val := __now - var __embed_stmt = __sqlbundle_Literal("INSERT INTO node_api_versions ( id, api_version, created_at, updated_at ) VALUES ( ?, ?, ?, ? )") + var __embed_stmt = __sqlbundle_Literal("INSERT INTO node_api_versions ( id, api_version, created_at, updated_at ) VALUES ( ?, ?, ?, ? ) ON CONFLICT ( id ) DO UPDATE SET id = EXCLUDED.id, api_version = EXCLUDED.api_version, created_at = EXCLUDED.created_at, updated_at = EXCLUDED.updated_at") var __values []interface{} __values = append(__values, __id_val, __api_version_val, __created_at_val, __updated_at_val) @@ -10531,7 +10531,7 @@ func (obj *postgresImpl) CreateNoReturn_NodeApiVersion(ctx context.Context, } -func (obj *postgresImpl) Get_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, +func (obj *pgxImpl) Get_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, value_attribution_project_id ValueAttribution_ProjectId_Field, value_attribution_bucket_name ValueAttribution_BucketName_Field) ( value_attribution *ValueAttribution, err error) { @@ -10554,7 +10554,7 @@ func (obj *postgresImpl) Get_ValueAttribution_By_ProjectId_And_BucketName(ctx co } -func (obj *postgresImpl) Get_PendingAudits_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Get_PendingAudits_By_NodeId(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field) ( pending_audits *PendingAudits, err error) { defer mon.Task()(&ctx)(&err) @@ -10576,7 +10576,7 @@ func (obj *postgresImpl) Get_PendingAudits_By_NodeId(ctx context.Context, } -func (obj *postgresImpl) Get_Irreparabledb_By_Segmentpath(ctx context.Context, +func (obj *pgxImpl) Get_Irreparabledb_By_Segmentpath(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) ( irreparabledb *Irreparabledb, err error) { defer mon.Task()(&ctx)(&err) @@ -10598,7 +10598,7 @@ func (obj *postgresImpl) Get_Irreparabledb_By_Segmentpath(ctx context.Context, } -func (obj *postgresImpl) Limited_Irreparabledb_By_Segmentpath_Greater_OrderBy_Asc_Segmentpath(ctx context.Context, +func (obj *pgxImpl) Limited_Irreparabledb_By_Segmentpath_Greater_OrderBy_Asc_Segmentpath(ctx context.Context, irreparabledb_segmentpath_greater Irreparabledb_Segmentpath_Field, limit int, offset int64) ( rows []*Irreparabledb, err error) { @@ -10635,7 +10635,7 @@ func (obj *postgresImpl) Limited_Irreparabledb_By_Segmentpath_Greater_OrderBy_As } -func (obj *postgresImpl) Find_AccountingTimestamps_Value_By_Name(ctx context.Context, +func (obj *pgxImpl) Find_AccountingTimestamps_Value_By_Name(ctx context.Context, accounting_timestamps_name AccountingTimestamps_Name_Field) ( row *Value_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -10660,7 +10660,7 @@ func (obj *postgresImpl) Find_AccountingTimestamps_Value_By_Name(ctx context.Con } -func (obj *postgresImpl) Get_AccountingRollup_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_AccountingRollup_By_Id(ctx context.Context, accounting_rollup_id AccountingRollup_Id_Field) ( accounting_rollup *AccountingRollup, err error) { defer mon.Task()(&ctx)(&err) @@ -10682,7 +10682,7 @@ func (obj *postgresImpl) Get_AccountingRollup_By_Id(ctx context.Context, } -func (obj *postgresImpl) All_AccountingRollup_By_StartTime_GreaterOrEqual(ctx context.Context, +func (obj *pgxImpl) All_AccountingRollup_By_StartTime_GreaterOrEqual(ctx context.Context, accounting_rollup_start_time_greater_or_equal AccountingRollup_StartTime_Field) ( rows []*AccountingRollup, err error) { defer mon.Task()(&ctx)(&err) @@ -10716,7 +10716,7 @@ func (obj *postgresImpl) All_AccountingRollup_By_StartTime_GreaterOrEqual(ctx co } -func (obj *postgresImpl) Get_Node_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_Node_By_Id(ctx context.Context, node_id Node_Id_Field) ( node *Node, err error) { defer mon.Task()(&ctx)(&err) @@ -10738,7 +10738,7 @@ func (obj *postgresImpl) Get_Node_By_Id(ctx context.Context, } -func (obj *postgresImpl) All_Node_Id(ctx context.Context) ( +func (obj *pgxImpl) All_Node_Id(ctx context.Context) ( rows []*Id_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -10770,7 +10770,7 @@ func (obj *postgresImpl) All_Node_Id(ctx context.Context) ( } -func (obj *postgresImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx context.Context, +func (obj *pgxImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx context.Context, node_id_greater_or_equal Node_Id_Field, limit int, offset int64) ( rows []*Node, err error) { @@ -10807,7 +10807,7 @@ func (obj *postgresImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx co } -func (obj *postgresImpl) All_Node_Id_Node_PieceCount_By_PieceCount_Not_Number(ctx context.Context) ( +func (obj *pgxImpl) All_Node_Id_Node_PieceCount_By_PieceCount_Not_Number(ctx context.Context) ( rows []*Id_PieceCount_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -10839,7 +10839,7 @@ func (obj *postgresImpl) All_Node_Id_Node_PieceCount_By_PieceCount_Not_Number(ct } -func (obj *postgresImpl) Limited_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactFailure(ctx context.Context, +func (obj *pgxImpl) Limited_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactFailure(ctx context.Context, limit int, offset int64) ( rows []*Id_Address_LastIpPort_LastContactSuccess_LastContactFailure_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -10874,7 +10874,7 @@ func (obj *postgresImpl) Limited_Node_Id_Node_Address_Node_LastIpPort_Node_LastC } -func (obj *postgresImpl) All_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_And_LastContactSuccess_Greater_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactSuccess(ctx context.Context, +func (obj *pgxImpl) All_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_And_LastContactSuccess_Greater_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactSuccess(ctx context.Context, node_last_contact_success_less Node_LastContactSuccess_Field) ( rows []*Id_Address_LastIpPort_LastContactSuccess_LastContactFailure_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -10908,7 +10908,7 @@ func (obj *postgresImpl) All_Node_Id_Node_Address_Node_LastIpPort_Node_LastConta } -func (obj *postgresImpl) Get_AuditHistory_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Get_AuditHistory_By_NodeId(ctx context.Context, audit_history_node_id AuditHistory_NodeId_Field) ( audit_history *AuditHistory, err error) { defer mon.Task()(&ctx)(&err) @@ -10930,7 +10930,7 @@ func (obj *postgresImpl) Get_AuditHistory_By_NodeId(ctx context.Context, } -func (obj *postgresImpl) Get_User_By_NormalizedEmail_And_Status_Not_Number(ctx context.Context, +func (obj *pgxImpl) Get_User_By_NormalizedEmail_And_Status_Not_Number(ctx context.Context, user_normalized_email User_NormalizedEmail_Field) ( user *User, err error) { defer mon.Task()(&ctx)(&err) @@ -10974,7 +10974,7 @@ func (obj *postgresImpl) Get_User_By_NormalizedEmail_And_Status_Not_Number(ctx c } -func (obj *postgresImpl) Get_User_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_User_By_Id(ctx context.Context, user_id User_Id_Field) ( user *User, err error) { defer mon.Task()(&ctx)(&err) @@ -10996,7 +10996,7 @@ func (obj *postgresImpl) Get_User_By_Id(ctx context.Context, } -func (obj *postgresImpl) Get_Project_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_Project_By_Id(ctx context.Context, project_id Project_Id_Field) ( project *Project, err error) { defer mon.Task()(&ctx)(&err) @@ -11018,7 +11018,7 @@ func (obj *postgresImpl) Get_Project_By_Id(ctx context.Context, } -func (obj *postgresImpl) Get_Project_UsageLimit_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_Project_UsageLimit_By_Id(ctx context.Context, project_id Project_Id_Field) ( row *UsageLimit_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -11040,7 +11040,7 @@ func (obj *postgresImpl) Get_Project_UsageLimit_By_Id(ctx context.Context, } -func (obj *postgresImpl) Get_Project_BandwidthLimit_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_Project_BandwidthLimit_By_Id(ctx context.Context, project_id Project_Id_Field) ( row *BandwidthLimit_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -11062,7 +11062,7 @@ func (obj *postgresImpl) Get_Project_BandwidthLimit_By_Id(ctx context.Context, } -func (obj *postgresImpl) All_Project(ctx context.Context) ( +func (obj *pgxImpl) All_Project(ctx context.Context) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -11094,7 +11094,7 @@ func (obj *postgresImpl) All_Project(ctx context.Context) ( } -func (obj *postgresImpl) All_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, project_created_at_less Project_CreatedAt_Field) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -11128,7 +11128,7 @@ func (obj *postgresImpl) All_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx } -func (obj *postgresImpl) All_Project_By_OwnerId_OrderBy_Asc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_Project_By_OwnerId_OrderBy_Asc_CreatedAt(ctx context.Context, project_owner_id Project_OwnerId_Field) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -11162,7 +11162,7 @@ func (obj *postgresImpl) All_Project_By_OwnerId_OrderBy_Asc_CreatedAt(ctx contex } -func (obj *postgresImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Project_Name(ctx context.Context, +func (obj *pgxImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Project_Name(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -11196,7 +11196,7 @@ func (obj *postgresImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Proje } -func (obj *postgresImpl) Limited_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) Limited_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, project_created_at_less Project_CreatedAt_Field, limit int, offset int64) ( rows []*Project, err error) { @@ -11233,7 +11233,7 @@ func (obj *postgresImpl) Limited_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt } -func (obj *postgresImpl) Get_ProjectInvoiceStamp_By_ProjectId_And_StartDate(ctx context.Context, +func (obj *pgxImpl) Get_ProjectInvoiceStamp_By_ProjectId_And_StartDate(ctx context.Context, project_invoice_stamp_project_id ProjectInvoiceStamp_ProjectId_Field, project_invoice_stamp_start_date ProjectInvoiceStamp_StartDate_Field) ( project_invoice_stamp *ProjectInvoiceStamp, err error) { @@ -11278,7 +11278,7 @@ func (obj *postgresImpl) Get_ProjectInvoiceStamp_By_ProjectId_And_StartDate(ctx } -func (obj *postgresImpl) All_ProjectInvoiceStamp_By_ProjectId_OrderBy_Desc_StartDate(ctx context.Context, +func (obj *pgxImpl) All_ProjectInvoiceStamp_By_ProjectId_OrderBy_Desc_StartDate(ctx context.Context, project_invoice_stamp_project_id ProjectInvoiceStamp_ProjectId_Field) ( rows []*ProjectInvoiceStamp, err error) { defer mon.Task()(&ctx)(&err) @@ -11312,7 +11312,7 @@ func (obj *postgresImpl) All_ProjectInvoiceStamp_By_ProjectId_OrderBy_Desc_Start } -func (obj *postgresImpl) All_ProjectMember_By_MemberId(ctx context.Context, +func (obj *pgxImpl) All_ProjectMember_By_MemberId(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field) ( rows []*ProjectMember, err error) { defer mon.Task()(&ctx)(&err) @@ -11346,7 +11346,7 @@ func (obj *postgresImpl) All_ProjectMember_By_MemberId(ctx context.Context, } -func (obj *postgresImpl) Limited_ProjectMember_By_ProjectId(ctx context.Context, +func (obj *pgxImpl) Limited_ProjectMember_By_ProjectId(ctx context.Context, project_member_project_id ProjectMember_ProjectId_Field, limit int, offset int64) ( rows []*ProjectMember, err error) { @@ -11383,7 +11383,7 @@ func (obj *postgresImpl) Limited_ProjectMember_By_ProjectId(ctx context.Context, } -func (obj *postgresImpl) Get_ApiKey_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_ApiKey_By_Id(ctx context.Context, api_key_id ApiKey_Id_Field) ( api_key *ApiKey, err error) { defer mon.Task()(&ctx)(&err) @@ -11405,7 +11405,7 @@ func (obj *postgresImpl) Get_ApiKey_By_Id(ctx context.Context, } -func (obj *postgresImpl) Get_ApiKey_By_Head(ctx context.Context, +func (obj *pgxImpl) Get_ApiKey_By_Head(ctx context.Context, api_key_head ApiKey_Head_Field) ( api_key *ApiKey, err error) { defer mon.Task()(&ctx)(&err) @@ -11427,7 +11427,7 @@ func (obj *postgresImpl) Get_ApiKey_By_Head(ctx context.Context, } -func (obj *postgresImpl) Get_ApiKey_By_Name_And_ProjectId(ctx context.Context, +func (obj *pgxImpl) Get_ApiKey_By_Name_And_ProjectId(ctx context.Context, api_key_name ApiKey_Name_Field, api_key_project_id ApiKey_ProjectId_Field) ( api_key *ApiKey, err error) { @@ -11450,7 +11450,7 @@ func (obj *postgresImpl) Get_ApiKey_By_Name_And_ProjectId(ctx context.Context, } -func (obj *postgresImpl) All_ApiKey_By_ProjectId_OrderBy_Asc_Name(ctx context.Context, +func (obj *pgxImpl) All_ApiKey_By_ProjectId_OrderBy_Asc_Name(ctx context.Context, api_key_project_id ApiKey_ProjectId_Field) ( rows []*ApiKey, err error) { defer mon.Task()(&ctx)(&err) @@ -11484,7 +11484,7 @@ func (obj *postgresImpl) All_ApiKey_By_ProjectId_OrderBy_Asc_Name(ctx context.Co } -func (obj *postgresImpl) Find_SerialNumber_By_SerialNumber(ctx context.Context, +func (obj *pgxImpl) Find_SerialNumber_By_SerialNumber(ctx context.Context, serial_number_serial_number SerialNumber_SerialNumber_Field) ( serial_number *SerialNumber, err error) { defer mon.Task()(&ctx)(&err) @@ -11528,7 +11528,7 @@ func (obj *postgresImpl) Find_SerialNumber_By_SerialNumber(ctx context.Context, } -func (obj *postgresImpl) Paged_PendingSerialQueue(ctx context.Context, +func (obj *pgxImpl) Paged_PendingSerialQueue(ctx context.Context, limit int, start *Paged_PendingSerialQueue_Continuation) ( rows []*PendingSerialQueue, next *Paged_PendingSerialQueue_Continuation, err error) { defer mon.Task()(&ctx)(&err) @@ -11575,7 +11575,7 @@ func (obj *postgresImpl) Paged_PendingSerialQueue(ctx context.Context, } -func (obj *postgresImpl) Has_ConsumedSerial_By_StorageNodeId_And_SerialNumber(ctx context.Context, +func (obj *pgxImpl) Has_ConsumedSerial_By_StorageNodeId_And_SerialNumber(ctx context.Context, consumed_serial_storage_node_id ConsumedSerial_StorageNodeId_Field, consumed_serial_serial_number ConsumedSerial_SerialNumber_Field) ( has bool, err error) { @@ -11597,7 +11597,7 @@ func (obj *postgresImpl) Has_ConsumedSerial_By_StorageNodeId_And_SerialNumber(ct } -func (obj *postgresImpl) Find_BucketBandwidthRollup_By_BucketName_And_ProjectId_And_IntervalStart_And_Action(ctx context.Context, +func (obj *pgxImpl) Find_BucketBandwidthRollup_By_BucketName_And_ProjectId_And_IntervalStart_And_Action(ctx context.Context, bucket_bandwidth_rollup_bucket_name BucketBandwidthRollup_BucketName_Field, bucket_bandwidth_rollup_project_id BucketBandwidthRollup_ProjectId_Field, bucket_bandwidth_rollup_interval_start BucketBandwidthRollup_IntervalStart_Field, @@ -11625,7 +11625,7 @@ func (obj *postgresImpl) Find_BucketBandwidthRollup_By_BucketName_And_ProjectId_ } -func (obj *postgresImpl) Find_ProjectBandwidthRollup_By_ProjectId_And_IntervalMonth(ctx context.Context, +func (obj *pgxImpl) Find_ProjectBandwidthRollup_By_ProjectId_And_IntervalMonth(ctx context.Context, project_bandwidth_rollup_project_id ProjectBandwidthRollup_ProjectId_Field, project_bandwidth_rollup_interval_month ProjectBandwidthRollup_IntervalMonth_Field) ( project_bandwidth_rollup *ProjectBandwidthRollup, err error) { @@ -11651,7 +11651,7 @@ func (obj *postgresImpl) Find_ProjectBandwidthRollup_By_ProjectId_And_IntervalMo } -func (obj *postgresImpl) First_BucketStorageTally_By_ProjectId_OrderBy_Desc_IntervalStart(ctx context.Context, +func (obj *pgxImpl) First_BucketStorageTally_By_ProjectId_OrderBy_Desc_IntervalStart(ctx context.Context, bucket_storage_tally_project_id BucketStorageTally_ProjectId_Field) ( bucket_storage_tally *BucketStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -11687,7 +11687,7 @@ func (obj *postgresImpl) First_BucketStorageTally_By_ProjectId_OrderBy_Desc_Inte } -func (obj *postgresImpl) All_BucketStorageTally(ctx context.Context) ( +func (obj *pgxImpl) All_BucketStorageTally(ctx context.Context) ( rows []*BucketStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -11719,7 +11719,7 @@ func (obj *postgresImpl) All_BucketStorageTally(ctx context.Context) ( } -func (obj *postgresImpl) All_BucketStorageTally_By_ProjectId_And_BucketName_And_IntervalStart_GreaterOrEqual_And_IntervalStart_LessOrEqual_OrderBy_Desc_IntervalStart(ctx context.Context, +func (obj *pgxImpl) All_BucketStorageTally_By_ProjectId_And_BucketName_And_IntervalStart_GreaterOrEqual_And_IntervalStart_LessOrEqual_OrderBy_Desc_IntervalStart(ctx context.Context, bucket_storage_tally_project_id BucketStorageTally_ProjectId_Field, bucket_storage_tally_bucket_name BucketStorageTally_BucketName_Field, bucket_storage_tally_interval_start_greater_or_equal BucketStorageTally_IntervalStart_Field, @@ -11756,7 +11756,7 @@ func (obj *postgresImpl) All_BucketStorageTally_By_ProjectId_And_BucketName_And_ } -func (obj *postgresImpl) Find_StoragenodeBandwidthRollup_By_StoragenodeId_And_IntervalStart_And_Action(ctx context.Context, +func (obj *pgxImpl) Find_StoragenodeBandwidthRollup_By_StoragenodeId_And_IntervalStart_And_Action(ctx context.Context, storagenode_bandwidth_rollup_storagenode_id StoragenodeBandwidthRollup_StoragenodeId_Field, storagenode_bandwidth_rollup_interval_start StoragenodeBandwidthRollup_IntervalStart_Field, storagenode_bandwidth_rollup_action StoragenodeBandwidthRollup_Action_Field) ( @@ -11783,7 +11783,7 @@ func (obj *postgresImpl) Find_StoragenodeBandwidthRollup_By_StoragenodeId_And_In } -func (obj *postgresImpl) All_StoragenodeBandwidthRollup_By_IntervalStart_GreaterOrEqual(ctx context.Context, +func (obj *pgxImpl) All_StoragenodeBandwidthRollup_By_IntervalStart_GreaterOrEqual(ctx context.Context, storagenode_bandwidth_rollup_interval_start_greater_or_equal StoragenodeBandwidthRollup_IntervalStart_Field) ( rows []*StoragenodeBandwidthRollup, err error) { defer mon.Task()(&ctx)(&err) @@ -11817,7 +11817,7 @@ func (obj *postgresImpl) All_StoragenodeBandwidthRollup_By_IntervalStart_Greater } -func (obj *postgresImpl) All_StoragenodeStorageTally(ctx context.Context) ( +func (obj *pgxImpl) All_StoragenodeStorageTally(ctx context.Context) ( rows []*StoragenodeStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -11849,7 +11849,7 @@ func (obj *postgresImpl) All_StoragenodeStorageTally(ctx context.Context) ( } -func (obj *postgresImpl) All_StoragenodeStorageTally_By_IntervalEndTime_GreaterOrEqual(ctx context.Context, +func (obj *pgxImpl) All_StoragenodeStorageTally_By_IntervalEndTime_GreaterOrEqual(ctx context.Context, storagenode_storage_tally_interval_end_time_greater_or_equal StoragenodeStorageTally_IntervalEndTime_Field) ( rows []*StoragenodeStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -11883,7 +11883,7 @@ func (obj *postgresImpl) All_StoragenodeStorageTally_By_IntervalEndTime_GreaterO } -func (obj *postgresImpl) Get_PeerIdentity_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Get_PeerIdentity_By_NodeId(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field) ( peer_identity *PeerIdentity, err error) { defer mon.Task()(&ctx)(&err) @@ -11905,7 +11905,7 @@ func (obj *postgresImpl) Get_PeerIdentity_By_NodeId(ctx context.Context, } -func (obj *postgresImpl) Get_PeerIdentity_LeafSerialNumber_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Get_PeerIdentity_LeafSerialNumber_By_NodeId(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field) ( row *LeafSerialNumber_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -11927,7 +11927,7 @@ func (obj *postgresImpl) Get_PeerIdentity_LeafSerialNumber_By_NodeId(ctx context } -func (obj *postgresImpl) Get_RegistrationToken_By_Secret(ctx context.Context, +func (obj *pgxImpl) Get_RegistrationToken_By_Secret(ctx context.Context, registration_token_secret RegistrationToken_Secret_Field) ( registration_token *RegistrationToken, err error) { defer mon.Task()(&ctx)(&err) @@ -11949,7 +11949,7 @@ func (obj *postgresImpl) Get_RegistrationToken_By_Secret(ctx context.Context, } -func (obj *postgresImpl) Get_RegistrationToken_By_OwnerId(ctx context.Context, +func (obj *pgxImpl) Get_RegistrationToken_By_OwnerId(ctx context.Context, registration_token_owner_id RegistrationToken_OwnerId_Field) ( registration_token *RegistrationToken, err error) { defer mon.Task()(&ctx)(&err) @@ -11976,7 +11976,7 @@ func (obj *postgresImpl) Get_RegistrationToken_By_OwnerId(ctx context.Context, } -func (obj *postgresImpl) Get_ResetPasswordToken_By_Secret(ctx context.Context, +func (obj *pgxImpl) Get_ResetPasswordToken_By_Secret(ctx context.Context, reset_password_token_secret ResetPasswordToken_Secret_Field) ( reset_password_token *ResetPasswordToken, err error) { defer mon.Task()(&ctx)(&err) @@ -11998,7 +11998,7 @@ func (obj *postgresImpl) Get_ResetPasswordToken_By_Secret(ctx context.Context, } -func (obj *postgresImpl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context, +func (obj *pgxImpl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context, reset_password_token_owner_id ResetPasswordToken_OwnerId_Field) ( reset_password_token *ResetPasswordToken, err error) { defer mon.Task()(&ctx)(&err) @@ -12020,7 +12020,7 @@ func (obj *postgresImpl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context, } -func (obj *postgresImpl) Get_Offer_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_Offer_By_Id(ctx context.Context, offer_id Offer_Id_Field) ( offer *Offer, err error) { defer mon.Task()(&ctx)(&err) @@ -12042,7 +12042,7 @@ func (obj *postgresImpl) Get_Offer_By_Id(ctx context.Context, } -func (obj *postgresImpl) All_Offer_OrderBy_Asc_Id(ctx context.Context) ( +func (obj *pgxImpl) All_Offer_OrderBy_Asc_Id(ctx context.Context) ( rows []*Offer, err error) { defer mon.Task()(&ctx)(&err) @@ -12074,7 +12074,7 @@ func (obj *postgresImpl) All_Offer_OrderBy_Asc_Id(ctx context.Context) ( } -func (obj *postgresImpl) All_UserCredit_By_UserId_And_ExpiresAt_Greater_And_CreditsUsedInCents_Less_CreditsEarnedInCents_OrderBy_Asc_ExpiresAt(ctx context.Context, +func (obj *pgxImpl) All_UserCredit_By_UserId_And_ExpiresAt_Greater_And_CreditsUsedInCents_Less_CreditsEarnedInCents_OrderBy_Asc_ExpiresAt(ctx context.Context, user_credit_user_id UserCredit_UserId_Field, user_credit_expires_at_greater UserCredit_ExpiresAt_Field) ( rows []*UserCredit, err error) { @@ -12109,7 +12109,7 @@ func (obj *postgresImpl) All_UserCredit_By_UserId_And_ExpiresAt_Greater_And_Cred } -func (obj *postgresImpl) Count_UserCredit_By_ReferredBy(ctx context.Context, +func (obj *pgxImpl) Count_UserCredit_By_ReferredBy(ctx context.Context, user_credit_referred_by UserCredit_ReferredBy_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -12136,7 +12136,7 @@ func (obj *postgresImpl) Count_UserCredit_By_ReferredBy(ctx context.Context, } -func (obj *postgresImpl) Get_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, +func (obj *pgxImpl) Get_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field) ( bucket_metainfo *BucketMetainfo, err error) { @@ -12159,7 +12159,7 @@ func (obj *postgresImpl) Get_BucketMetainfo_By_ProjectId_And_Name(ctx context.Co } -func (obj *postgresImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_GreaterOrEqual_OrderBy_Asc_Name(ctx context.Context, +func (obj *pgxImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_GreaterOrEqual_OrderBy_Asc_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name_greater_or_equal BucketMetainfo_Name_Field, limit int, offset int64) ( @@ -12197,7 +12197,7 @@ func (obj *postgresImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_GreaterOrE } -func (obj *postgresImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_Greater_OrderBy_Asc_Name(ctx context.Context, +func (obj *pgxImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_Greater_OrderBy_Asc_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name_greater BucketMetainfo_Name_Field, limit int, offset int64) ( @@ -12235,7 +12235,7 @@ func (obj *postgresImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_Greater_Or } -func (obj *postgresImpl) Get_GracefulExitProgress_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Get_GracefulExitProgress_By_NodeId(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field) ( graceful_exit_progress *GracefulExitProgress, err error) { defer mon.Task()(&ctx)(&err) @@ -12257,7 +12257,7 @@ func (obj *postgresImpl) Get_GracefulExitProgress_By_NodeId(ctx context.Context, } -func (obj *postgresImpl) Get_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, +func (obj *pgxImpl) Get_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field) ( @@ -12281,7 +12281,7 @@ func (obj *postgresImpl) Get_GracefulExitTransferQueue_By_NodeId_And_Path_And_Pi } -func (obj *postgresImpl) All_NodesOfflineTime_By_NodeId_And_TrackedAt_Greater_And_TrackedAt_LessOrEqual(ctx context.Context, +func (obj *pgxImpl) All_NodesOfflineTime_By_NodeId_And_TrackedAt_Greater_And_TrackedAt_LessOrEqual(ctx context.Context, nodes_offline_time_node_id NodesOfflineTime_NodeId_Field, nodes_offline_time_tracked_at_greater NodesOfflineTime_TrackedAt_Field, nodes_offline_time_tracked_at_less_or_equal NodesOfflineTime_TrackedAt_Field) ( @@ -12317,7 +12317,7 @@ func (obj *postgresImpl) All_NodesOfflineTime_By_NodeId_And_TrackedAt_Greater_An } -func (obj *postgresImpl) Get_StripeCustomer_CustomerId_By_UserId(ctx context.Context, +func (obj *pgxImpl) Get_StripeCustomer_CustomerId_By_UserId(ctx context.Context, stripe_customer_user_id StripeCustomer_UserId_Field) ( row *CustomerId_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -12339,7 +12339,7 @@ func (obj *postgresImpl) Get_StripeCustomer_CustomerId_By_UserId(ctx context.Con } -func (obj *postgresImpl) Limited_StripeCustomer_By_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) Limited_StripeCustomer_By_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, stripe_customer_created_at_less_or_equal StripeCustomer_CreatedAt_Field, limit int, offset int64) ( rows []*StripeCustomer, err error) { @@ -12376,7 +12376,7 @@ func (obj *postgresImpl) Limited_StripeCustomer_By_CreatedAt_LessOrEqual_OrderBy } -func (obj *postgresImpl) All_CoinpaymentsTransaction_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_CoinpaymentsTransaction_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, coinpayments_transaction_user_id CoinpaymentsTransaction_UserId_Field) ( rows []*CoinpaymentsTransaction, err error) { defer mon.Task()(&ctx)(&err) @@ -12410,7 +12410,7 @@ func (obj *postgresImpl) All_CoinpaymentsTransaction_By_UserId_OrderBy_Desc_Crea } -func (obj *postgresImpl) Limited_CoinpaymentsTransaction_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) Limited_CoinpaymentsTransaction_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coinpayments_transaction_created_at_less_or_equal CoinpaymentsTransaction_CreatedAt_Field, coinpayments_transaction_status CoinpaymentsTransaction_Status_Field, limit int, offset int64) ( @@ -12448,7 +12448,7 @@ func (obj *postgresImpl) Limited_CoinpaymentsTransaction_By_CreatedAt_LessOrEqua } -func (obj *postgresImpl) Get_StripecoinpaymentsInvoiceProjectRecord_By_ProjectId_And_PeriodStart_And_PeriodEnd(ctx context.Context, +func (obj *pgxImpl) Get_StripecoinpaymentsInvoiceProjectRecord_By_ProjectId_And_PeriodStart_And_PeriodEnd(ctx context.Context, stripecoinpayments_invoice_project_record_project_id StripecoinpaymentsInvoiceProjectRecord_ProjectId_Field, stripecoinpayments_invoice_project_record_period_start StripecoinpaymentsInvoiceProjectRecord_PeriodStart_Field, stripecoinpayments_invoice_project_record_period_end StripecoinpaymentsInvoiceProjectRecord_PeriodEnd_Field) ( @@ -12472,7 +12472,7 @@ func (obj *postgresImpl) Get_StripecoinpaymentsInvoiceProjectRecord_By_ProjectId } -func (obj *postgresImpl) Limited_StripecoinpaymentsInvoiceProjectRecord_By_PeriodStart_And_PeriodEnd_And_State(ctx context.Context, +func (obj *pgxImpl) Limited_StripecoinpaymentsInvoiceProjectRecord_By_PeriodStart_And_PeriodEnd_And_State(ctx context.Context, stripecoinpayments_invoice_project_record_period_start StripecoinpaymentsInvoiceProjectRecord_PeriodStart_Field, stripecoinpayments_invoice_project_record_period_end StripecoinpaymentsInvoiceProjectRecord_PeriodEnd_Field, stripecoinpayments_invoice_project_record_state StripecoinpaymentsInvoiceProjectRecord_State_Field, @@ -12511,7 +12511,7 @@ func (obj *postgresImpl) Limited_StripecoinpaymentsInvoiceProjectRecord_By_Perio } -func (obj *postgresImpl) Get_StripecoinpaymentsTxConversionRate_By_TxId(ctx context.Context, +func (obj *pgxImpl) Get_StripecoinpaymentsTxConversionRate_By_TxId(ctx context.Context, stripecoinpayments_tx_conversion_rate_tx_id StripecoinpaymentsTxConversionRate_TxId_Field) ( stripecoinpayments_tx_conversion_rate *StripecoinpaymentsTxConversionRate, err error) { defer mon.Task()(&ctx)(&err) @@ -12533,7 +12533,7 @@ func (obj *postgresImpl) Get_StripecoinpaymentsTxConversionRate_By_TxId(ctx cont } -func (obj *postgresImpl) Get_Coupon_By_Id(ctx context.Context, +func (obj *pgxImpl) Get_Coupon_By_Id(ctx context.Context, coupon_id Coupon_Id_Field) ( coupon *Coupon, err error) { defer mon.Task()(&ctx)(&err) @@ -12555,7 +12555,7 @@ func (obj *postgresImpl) Get_Coupon_By_Id(ctx context.Context, } -func (obj *postgresImpl) All_Coupon_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_Coupon_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_user_id Coupon_UserId_Field) ( rows []*Coupon, err error) { defer mon.Task()(&ctx)(&err) @@ -12589,7 +12589,7 @@ func (obj *postgresImpl) All_Coupon_By_UserId_OrderBy_Desc_CreatedAt(ctx context } -func (obj *postgresImpl) All_Coupon_By_UserId_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_Coupon_By_UserId_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_user_id Coupon_UserId_Field, coupon_status Coupon_Status_Field) ( rows []*Coupon, err error) { @@ -12624,7 +12624,7 @@ func (obj *postgresImpl) All_Coupon_By_UserId_And_Status_OrderBy_Desc_CreatedAt( } -func (obj *postgresImpl) All_Coupon_By_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_Coupon_By_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_status Coupon_Status_Field) ( rows []*Coupon, err error) { defer mon.Task()(&ctx)(&err) @@ -12658,7 +12658,7 @@ func (obj *postgresImpl) All_Coupon_By_Status_OrderBy_Desc_CreatedAt(ctx context } -func (obj *postgresImpl) Limited_Coupon_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) Limited_Coupon_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_created_at_less_or_equal Coupon_CreatedAt_Field, coupon_status Coupon_Status_Field, limit int, offset int64) ( @@ -12696,7 +12696,7 @@ func (obj *postgresImpl) Limited_Coupon_By_CreatedAt_LessOrEqual_And_Status_Orde } -func (obj *postgresImpl) Limited_CouponUsage_By_Period_And_Status_Equal_Number(ctx context.Context, +func (obj *pgxImpl) Limited_CouponUsage_By_Period_And_Status_Equal_Number(ctx context.Context, coupon_usage_period CouponUsage_Period_Field, limit int, offset int64) ( rows []*CouponUsage, err error) { @@ -12733,7 +12733,7 @@ func (obj *postgresImpl) Limited_CouponUsage_By_Period_And_Status_Equal_Number(c } -func (obj *postgresImpl) Get_Credit_By_TransactionId(ctx context.Context, +func (obj *pgxImpl) Get_Credit_By_TransactionId(ctx context.Context, credit_transaction_id Credit_TransactionId_Field) ( credit *Credit, err error) { defer mon.Task()(&ctx)(&err) @@ -12755,7 +12755,7 @@ func (obj *postgresImpl) Get_Credit_By_TransactionId(ctx context.Context, } -func (obj *postgresImpl) All_Credit_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_Credit_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, credit_user_id Credit_UserId_Field) ( rows []*Credit, err error) { defer mon.Task()(&ctx)(&err) @@ -12789,7 +12789,7 @@ func (obj *postgresImpl) All_Credit_By_UserId_OrderBy_Desc_CreatedAt(ctx context } -func (obj *postgresImpl) Limited_Credit_By_UserId_And_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) Limited_Credit_By_UserId_And_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, credit_user_id Credit_UserId_Field, credit_created_at_less_or_equal Credit_CreatedAt_Field, limit int, offset int64) ( @@ -12827,7 +12827,7 @@ func (obj *postgresImpl) Limited_Credit_By_UserId_And_CreatedAt_LessOrEqual_Orde } -func (obj *postgresImpl) All_CreditsSpending_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxImpl) All_CreditsSpending_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, credits_spending_user_id CreditsSpending_UserId_Field) ( rows []*CreditsSpending, err error) { defer mon.Task()(&ctx)(&err) @@ -12861,7 +12861,7 @@ func (obj *postgresImpl) All_CreditsSpending_By_UserId_OrderBy_Desc_CreatedAt(ct } -func (obj *postgresImpl) Limited_CreditsSpending_By_Period_And_Status(ctx context.Context, +func (obj *pgxImpl) Limited_CreditsSpending_By_Period_And_Status(ctx context.Context, credits_spending_period CreditsSpending_Period_Field, credits_spending_status CreditsSpending_Status_Field, limit int, offset int64) ( @@ -12899,7 +12899,7 @@ func (obj *postgresImpl) Limited_CreditsSpending_By_Period_And_Status(ctx contex } -func (obj *postgresImpl) Has_NodeApiVersion_By_Id_And_ApiVersion_GreaterOrEqual(ctx context.Context, +func (obj *pgxImpl) Has_NodeApiVersion_By_Id_And_ApiVersion_GreaterOrEqual(ctx context.Context, node_api_version_id NodeApiVersion_Id_Field, node_api_version_api_version_greater_or_equal NodeApiVersion_ApiVersion_Field) ( has bool, err error) { @@ -12921,7 +12921,7 @@ func (obj *postgresImpl) Has_NodeApiVersion_By_Id_And_ApiVersion_GreaterOrEqual( } -func (obj *postgresImpl) Update_PendingAudits_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Update_PendingAudits_By_NodeId(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field, update PendingAudits_Update_Fields) ( pending_audits *PendingAudits, err error) { @@ -12962,7 +12962,7 @@ func (obj *postgresImpl) Update_PendingAudits_By_NodeId(ctx context.Context, return pending_audits, nil } -func (obj *postgresImpl) UpdateNoReturn_Irreparabledb_By_Segmentpath(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_Irreparabledb_By_Segmentpath(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field, update Irreparabledb_Update_Fields) ( err error) { @@ -13014,7 +13014,7 @@ func (obj *postgresImpl) UpdateNoReturn_Irreparabledb_By_Segmentpath(ctx context return nil } -func (obj *postgresImpl) UpdateNoReturn_AccountingTimestamps_By_Name(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_AccountingTimestamps_By_Name(ctx context.Context, accounting_timestamps_name AccountingTimestamps_Name_Field, update AccountingTimestamps_Update_Fields) ( err error) { @@ -13051,7 +13051,7 @@ func (obj *postgresImpl) UpdateNoReturn_AccountingTimestamps_By_Name(ctx context return nil } -func (obj *postgresImpl) Update_Node_By_Id(ctx context.Context, +func (obj *pgxImpl) Update_Node_By_Id(ctx context.Context, node_id Node_Id_Field, update Node_Update_Fields) ( node *Node, err error) { @@ -13283,7 +13283,7 @@ func (obj *postgresImpl) Update_Node_By_Id(ctx context.Context, return node, nil } -func (obj *postgresImpl) UpdateNoReturn_Node_By_Id(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_Node_By_Id(ctx context.Context, node_id Node_Id_Field, update Node_Update_Fields) ( err error) { @@ -13511,7 +13511,7 @@ func (obj *postgresImpl) UpdateNoReturn_Node_By_Id(ctx context.Context, return nil } -func (obj *postgresImpl) Update_AuditHistory_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Update_AuditHistory_By_NodeId(ctx context.Context, audit_history_node_id AuditHistory_NodeId_Field, update AuditHistory_Update_Fields) ( audit_history *AuditHistory, err error) { @@ -13552,7 +13552,7 @@ func (obj *postgresImpl) Update_AuditHistory_By_NodeId(ctx context.Context, return audit_history, nil } -func (obj *postgresImpl) Update_User_By_Id(ctx context.Context, +func (obj *pgxImpl) Update_User_By_Id(ctx context.Context, user_id User_Id_Field, update User_Update_Fields) ( user *User, err error) { @@ -13618,7 +13618,7 @@ func (obj *postgresImpl) Update_User_By_Id(ctx context.Context, return user, nil } -func (obj *postgresImpl) Update_Project_By_Id(ctx context.Context, +func (obj *pgxImpl) Update_Project_By_Id(ctx context.Context, project_id Project_Id_Field, update Project_Update_Fields) ( project *Project, err error) { @@ -13674,7 +13674,7 @@ func (obj *postgresImpl) Update_Project_By_Id(ctx context.Context, return project, nil } -func (obj *postgresImpl) UpdateNoReturn_ApiKey_By_Id(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_ApiKey_By_Id(ctx context.Context, api_key_id ApiKey_Id_Field, update ApiKey_Update_Fields) ( err error) { @@ -13711,7 +13711,7 @@ func (obj *postgresImpl) UpdateNoReturn_ApiKey_By_Id(ctx context.Context, return nil } -func (obj *postgresImpl) UpdateNoReturn_PeerIdentity_By_NodeId(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_PeerIdentity_By_NodeId(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field, update PeerIdentity_Update_Fields) ( err error) { @@ -13754,7 +13754,7 @@ func (obj *postgresImpl) UpdateNoReturn_PeerIdentity_By_NodeId(ctx context.Conte return nil } -func (obj *postgresImpl) Update_RegistrationToken_By_Secret(ctx context.Context, +func (obj *pgxImpl) Update_RegistrationToken_By_Secret(ctx context.Context, registration_token_secret RegistrationToken_Secret_Field, update RegistrationToken_Update_Fields) ( registration_token *RegistrationToken, err error) { @@ -13795,7 +13795,7 @@ func (obj *postgresImpl) Update_RegistrationToken_By_Secret(ctx context.Context, return registration_token, nil } -func (obj *postgresImpl) UpdateNoReturn_Offer_By_Id(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_Offer_By_Id(ctx context.Context, offer_id Offer_Id_Field, update Offer_Update_Fields) ( err error) { @@ -13877,7 +13877,7 @@ func (obj *postgresImpl) UpdateNoReturn_Offer_By_Id(ctx context.Context, return nil } -func (obj *postgresImpl) Update_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, +func (obj *pgxImpl) Update_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field, update BucketMetainfo_Update_Fields) ( @@ -13964,7 +13964,7 @@ func (obj *postgresImpl) Update_BucketMetainfo_By_ProjectId_And_Name(ctx context return bucket_metainfo, nil } -func (obj *postgresImpl) UpdateNoReturn_GracefulExitProgress_By_NodeId(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_GracefulExitProgress_By_NodeId(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field, update GracefulExitProgress_Update_Fields) ( err error) { @@ -14012,7 +14012,7 @@ func (obj *postgresImpl) UpdateNoReturn_GracefulExitProgress_By_NodeId(ctx conte return nil } -func (obj *postgresImpl) UpdateNoReturn_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field, @@ -14081,7 +14081,7 @@ func (obj *postgresImpl) UpdateNoReturn_GracefulExitTransferQueue_By_NodeId_And_ return nil } -func (obj *postgresImpl) Update_CoinpaymentsTransaction_By_Id(ctx context.Context, +func (obj *pgxImpl) Update_CoinpaymentsTransaction_By_Id(ctx context.Context, coinpayments_transaction_id CoinpaymentsTransaction_Id_Field, update CoinpaymentsTransaction_Update_Fields) ( coinpayments_transaction *CoinpaymentsTransaction, err error) { @@ -14127,7 +14127,7 @@ func (obj *postgresImpl) Update_CoinpaymentsTransaction_By_Id(ctx context.Contex return coinpayments_transaction, nil } -func (obj *postgresImpl) Update_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, +func (obj *pgxImpl) Update_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, stripecoinpayments_apply_balance_intent_tx_id StripecoinpaymentsApplyBalanceIntent_TxId_Field, update StripecoinpaymentsApplyBalanceIntent_Update_Fields) ( stripecoinpayments_apply_balance_intent *StripecoinpaymentsApplyBalanceIntent, err error) { @@ -14168,7 +14168,7 @@ func (obj *postgresImpl) Update_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx return stripecoinpayments_apply_balance_intent, nil } -func (obj *postgresImpl) Update_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, +func (obj *pgxImpl) Update_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, stripecoinpayments_invoice_project_record_id StripecoinpaymentsInvoiceProjectRecord_Id_Field, update StripecoinpaymentsInvoiceProjectRecord_Update_Fields) ( stripecoinpayments_invoice_project_record *StripecoinpaymentsInvoiceProjectRecord, err error) { @@ -14209,7 +14209,7 @@ func (obj *postgresImpl) Update_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx return stripecoinpayments_invoice_project_record, nil } -func (obj *postgresImpl) Update_Coupon_By_Id(ctx context.Context, +func (obj *pgxImpl) Update_Coupon_By_Id(ctx context.Context, coupon_id Coupon_Id_Field, update Coupon_Update_Fields) ( coupon *Coupon, err error) { @@ -14250,7 +14250,7 @@ func (obj *postgresImpl) Update_Coupon_By_Id(ctx context.Context, return coupon, nil } -func (obj *postgresImpl) Update_CouponUsage_By_CouponId_And_Period(ctx context.Context, +func (obj *pgxImpl) Update_CouponUsage_By_CouponId_And_Period(ctx context.Context, coupon_usage_coupon_id CouponUsage_CouponId_Field, coupon_usage_period CouponUsage_Period_Field, update CouponUsage_Update_Fields) ( @@ -14292,7 +14292,7 @@ func (obj *postgresImpl) Update_CouponUsage_By_CouponId_And_Period(ctx context.C return coupon_usage, nil } -func (obj *postgresImpl) Update_CreditsSpending_By_Id(ctx context.Context, +func (obj *pgxImpl) Update_CreditsSpending_By_Id(ctx context.Context, credits_spending_id CreditsSpending_Id_Field, update CreditsSpending_Update_Fields) ( credits_spending *CreditsSpending, err error) { @@ -14333,7 +14333,7 @@ func (obj *postgresImpl) Update_CreditsSpending_By_Id(ctx context.Context, return credits_spending, nil } -func (obj *postgresImpl) UpdateNoReturn_NodeApiVersion_By_Id_And_ApiVersion_Less(ctx context.Context, +func (obj *pgxImpl) UpdateNoReturn_NodeApiVersion_By_Id_And_ApiVersion_Less(ctx context.Context, node_api_version_id NodeApiVersion_Id_Field, node_api_version_api_version_less NodeApiVersion_ApiVersion_Field, update NodeApiVersion_Update_Fields) ( @@ -14372,7 +14372,7 @@ func (obj *postgresImpl) UpdateNoReturn_NodeApiVersion_By_Id_And_ApiVersion_Less return nil } -func (obj *postgresImpl) Delete_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, +func (obj *pgxImpl) Delete_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, value_attribution_project_id ValueAttribution_ProjectId_Field, value_attribution_bucket_name ValueAttribution_BucketName_Field) ( deleted bool, err error) { @@ -14400,7 +14400,7 @@ func (obj *postgresImpl) Delete_ValueAttribution_By_ProjectId_And_BucketName(ctx } -func (obj *postgresImpl) Delete_PendingAudits_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Delete_PendingAudits_By_NodeId(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14427,7 +14427,7 @@ func (obj *postgresImpl) Delete_PendingAudits_By_NodeId(ctx context.Context, } -func (obj *postgresImpl) Delete_Irreparabledb_By_Segmentpath(ctx context.Context, +func (obj *pgxImpl) Delete_Irreparabledb_By_Segmentpath(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14454,7 +14454,7 @@ func (obj *postgresImpl) Delete_Irreparabledb_By_Segmentpath(ctx context.Context } -func (obj *postgresImpl) Delete_AccountingRollup_By_Id(ctx context.Context, +func (obj *pgxImpl) Delete_AccountingRollup_By_Id(ctx context.Context, accounting_rollup_id AccountingRollup_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14481,7 +14481,7 @@ func (obj *postgresImpl) Delete_AccountingRollup_By_Id(ctx context.Context, } -func (obj *postgresImpl) Delete_Node_By_Id(ctx context.Context, +func (obj *pgxImpl) Delete_Node_By_Id(ctx context.Context, node_id Node_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14508,7 +14508,7 @@ func (obj *postgresImpl) Delete_Node_By_Id(ctx context.Context, } -func (obj *postgresImpl) Delete_User_By_Id(ctx context.Context, +func (obj *pgxImpl) Delete_User_By_Id(ctx context.Context, user_id User_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14535,7 +14535,7 @@ func (obj *postgresImpl) Delete_User_By_Id(ctx context.Context, } -func (obj *postgresImpl) Delete_Project_By_Id(ctx context.Context, +func (obj *pgxImpl) Delete_Project_By_Id(ctx context.Context, project_id Project_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14562,7 +14562,7 @@ func (obj *postgresImpl) Delete_Project_By_Id(ctx context.Context, } -func (obj *postgresImpl) Delete_ProjectMember_By_MemberId_And_ProjectId(ctx context.Context, +func (obj *pgxImpl) Delete_ProjectMember_By_MemberId_And_ProjectId(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field, project_member_project_id ProjectMember_ProjectId_Field) ( deleted bool, err error) { @@ -14590,7 +14590,7 @@ func (obj *postgresImpl) Delete_ProjectMember_By_MemberId_And_ProjectId(ctx cont } -func (obj *postgresImpl) Delete_ApiKey_By_Id(ctx context.Context, +func (obj *pgxImpl) Delete_ApiKey_By_Id(ctx context.Context, api_key_id ApiKey_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14617,7 +14617,7 @@ func (obj *postgresImpl) Delete_ApiKey_By_Id(ctx context.Context, } -func (obj *postgresImpl) Delete_SerialNumber_By_ExpiresAt_LessOrEqual(ctx context.Context, +func (obj *pgxImpl) Delete_SerialNumber_By_ExpiresAt_LessOrEqual(ctx context.Context, serial_number_expires_at_less_or_equal SerialNumber_ExpiresAt_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -14644,7 +14644,7 @@ func (obj *postgresImpl) Delete_SerialNumber_By_ExpiresAt_LessOrEqual(ctx contex } -func (obj *postgresImpl) Delete_ConsumedSerial_By_ExpiresAt_LessOrEqual(ctx context.Context, +func (obj *pgxImpl) Delete_ConsumedSerial_By_ExpiresAt_LessOrEqual(ctx context.Context, consumed_serial_expires_at_less_or_equal ConsumedSerial_ExpiresAt_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -14671,7 +14671,7 @@ func (obj *postgresImpl) Delete_ConsumedSerial_By_ExpiresAt_LessOrEqual(ctx cont } -func (obj *postgresImpl) Delete_ResetPasswordToken_By_Secret(ctx context.Context, +func (obj *pgxImpl) Delete_ResetPasswordToken_By_Secret(ctx context.Context, reset_password_token_secret ResetPasswordToken_Secret_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14698,7 +14698,7 @@ func (obj *postgresImpl) Delete_ResetPasswordToken_By_Secret(ctx context.Context } -func (obj *postgresImpl) Delete_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, +func (obj *pgxImpl) Delete_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field) ( deleted bool, err error) { @@ -14726,7 +14726,7 @@ func (obj *postgresImpl) Delete_BucketMetainfo_By_ProjectId_And_Name(ctx context } -func (obj *postgresImpl) Delete_GracefulExitProgress_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Delete_GracefulExitProgress_By_NodeId(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14753,7 +14753,7 @@ func (obj *postgresImpl) Delete_GracefulExitProgress_By_NodeId(ctx context.Conte } -func (obj *postgresImpl) Delete_GracefulExitTransferQueue_By_NodeId(ctx context.Context, +func (obj *pgxImpl) Delete_GracefulExitTransferQueue_By_NodeId(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -14780,7 +14780,7 @@ func (obj *postgresImpl) Delete_GracefulExitTransferQueue_By_NodeId(ctx context. } -func (obj *postgresImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, +func (obj *pgxImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field) ( @@ -14809,7 +14809,7 @@ func (obj *postgresImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Path_And } -func (obj *postgresImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_FinishedAt_IsNot_Null(ctx context.Context, +func (obj *pgxImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_FinishedAt_IsNot_Null(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -14836,7 +14836,7 @@ func (obj *postgresImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Finished } -func (obj *postgresImpl) Delete_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, +func (obj *pgxImpl) Delete_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, stripecoinpayments_apply_balance_intent_tx_id StripecoinpaymentsApplyBalanceIntent_TxId_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14863,7 +14863,7 @@ func (obj *postgresImpl) Delete_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx } -func (obj *postgresImpl) Delete_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, +func (obj *pgxImpl) Delete_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, stripecoinpayments_invoice_project_record_id StripecoinpaymentsInvoiceProjectRecord_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14890,7 +14890,7 @@ func (obj *postgresImpl) Delete_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx } -func (obj *postgresImpl) Delete_Coupon_By_Id(ctx context.Context, +func (obj *pgxImpl) Delete_Coupon_By_Id(ctx context.Context, coupon_id Coupon_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -14917,17 +14917,17 @@ func (obj *postgresImpl) Delete_Coupon_By_Id(ctx context.Context, } -func (impl postgresImpl) isConstraintError(err error) ( +func (impl pgxImpl) isConstraintError(err error) ( constraint string, ok bool) { - if e, ok := err.(*pq.Error); ok { - if e.Code.Class() == "23" { - return e.Constraint, true + if e, ok := err.(*pgconn.PgError); ok { + if e.Code[:2] == "23" { + return e.ConstraintName, true } } return "", false } -func (obj *postgresImpl) deleteAll(ctx context.Context) (count int64, err error) { +func (obj *pgxImpl) deleteAll(ctx context.Context) (count int64, err error) { defer mon.Task()(&ctx)(&err) var __res sql.Result var __count int64 @@ -15386,7 +15386,7 @@ func (obj *postgresImpl) deleteAll(ctx context.Context) (count int64, err error) } -func (obj *cockroachImpl) Create_ValueAttribution(ctx context.Context, +func (obj *pgxcockroachImpl) Create_ValueAttribution(ctx context.Context, value_attribution_project_id ValueAttribution_ProjectId_Field, value_attribution_bucket_name ValueAttribution_BucketName_Field, value_attribution_partner_id ValueAttribution_PartnerId_Field) ( @@ -15416,7 +15416,7 @@ func (obj *cockroachImpl) Create_ValueAttribution(ctx context.Context, } -func (obj *cockroachImpl) Create_PendingAudits(ctx context.Context, +func (obj *pgxcockroachImpl) Create_PendingAudits(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field, pending_audits_piece_id PendingAudits_PieceId_Field, pending_audits_stripe_index PendingAudits_StripeIndex_Field, @@ -15451,7 +15451,7 @@ func (obj *cockroachImpl) Create_PendingAudits(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_Irreparabledb(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_Irreparabledb(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field, irreparabledb_segmentdetail Irreparabledb_Segmentdetail_Field, irreparabledb_pieces_lost_count Irreparabledb_PiecesLostCount_Field, @@ -15481,7 +15481,7 @@ func (obj *cockroachImpl) CreateNoReturn_Irreparabledb(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_AccountingTimestamps(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_AccountingTimestamps(ctx context.Context, accounting_timestamps_name AccountingTimestamps_Name_Field, accounting_timestamps_value AccountingTimestamps_Value_Field) ( err error) { @@ -15505,7 +15505,7 @@ func (obj *cockroachImpl) CreateNoReturn_AccountingTimestamps(ctx context.Contex } -func (obj *cockroachImpl) CreateNoReturn_AccountingRollup(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_AccountingRollup(ctx context.Context, accounting_rollup_node_id AccountingRollup_NodeId_Field, accounting_rollup_start_time AccountingRollup_StartTime_Field, accounting_rollup_put_total AccountingRollup_PutTotal_Field, @@ -15541,7 +15541,7 @@ func (obj *cockroachImpl) CreateNoReturn_AccountingRollup(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_Node(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_Node(ctx context.Context, node_id Node_Id_Field, node_last_net Node_LastNet_Field, node_email Node_Email_Field, @@ -15737,7 +15737,7 @@ func (obj *cockroachImpl) CreateNoReturn_Node(ctx context.Context, } -func (obj *cockroachImpl) Create_AuditHistory(ctx context.Context, +func (obj *pgxcockroachImpl) Create_AuditHistory(ctx context.Context, audit_history_node_id AuditHistory_NodeId_Field, audit_history_history AuditHistory_History_Field) ( audit_history *AuditHistory, err error) { @@ -15762,7 +15762,7 @@ func (obj *cockroachImpl) Create_AuditHistory(ctx context.Context, } -func (obj *cockroachImpl) Create_User(ctx context.Context, +func (obj *pgxcockroachImpl) Create_User(ctx context.Context, user_id User_Id_Field, user_email User_Email_Field, user_normalized_email User_NormalizedEmail_Field, @@ -15800,7 +15800,7 @@ func (obj *cockroachImpl) Create_User(ctx context.Context, } -func (obj *cockroachImpl) Create_Project(ctx context.Context, +func (obj *pgxcockroachImpl) Create_Project(ctx context.Context, project_id Project_Id_Field, project_name Project_Name_Field, project_description Project_Description_Field, @@ -15862,7 +15862,7 @@ func (obj *cockroachImpl) Create_Project(ctx context.Context, } -func (obj *cockroachImpl) Create_ProjectInvoiceStamp(ctx context.Context, +func (obj *pgxcockroachImpl) Create_ProjectInvoiceStamp(ctx context.Context, project_invoice_stamp_project_id ProjectInvoiceStamp_ProjectId_Field, project_invoice_stamp_invoice_id ProjectInvoiceStamp_InvoiceId_Field, project_invoice_stamp_start_date ProjectInvoiceStamp_StartDate_Field, @@ -15893,7 +15893,7 @@ func (obj *cockroachImpl) Create_ProjectInvoiceStamp(ctx context.Context, } -func (obj *cockroachImpl) Create_ProjectMember(ctx context.Context, +func (obj *pgxcockroachImpl) Create_ProjectMember(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field, project_member_project_id ProjectMember_ProjectId_Field) ( project_member *ProjectMember, err error) { @@ -15921,7 +15921,7 @@ func (obj *cockroachImpl) Create_ProjectMember(ctx context.Context, } -func (obj *cockroachImpl) Create_ApiKey(ctx context.Context, +func (obj *pgxcockroachImpl) Create_ApiKey(ctx context.Context, api_key_id ApiKey_Id_Field, api_key_project_id ApiKey_ProjectId_Field, api_key_head ApiKey_Head_Field, @@ -15957,7 +15957,7 @@ func (obj *cockroachImpl) Create_ApiKey(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_SerialNumber(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_SerialNumber(ctx context.Context, serial_number_serial_number SerialNumber_SerialNumber_Field, serial_number_bucket_id SerialNumber_BucketId_Field, serial_number_expires_at SerialNumber_ExpiresAt_Field) ( @@ -15983,7 +15983,7 @@ func (obj *cockroachImpl) CreateNoReturn_SerialNumber(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_UsedSerial(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_UsedSerial(ctx context.Context, used_serial_serial_number_id UsedSerial_SerialNumberId_Field, used_serial_storage_node_id UsedSerial_StorageNodeId_Field) ( err error) { @@ -16007,7 +16007,7 @@ func (obj *cockroachImpl) CreateNoReturn_UsedSerial(ctx context.Context, } -func (obj *cockroachImpl) ReplaceNoReturn_PendingSerialQueue(ctx context.Context, +func (obj *pgxcockroachImpl) ReplaceNoReturn_PendingSerialQueue(ctx context.Context, pending_serial_queue_storage_node_id PendingSerialQueue_StorageNodeId_Field, pending_serial_queue_bucket_id PendingSerialQueue_BucketId_Field, pending_serial_queue_serial_number PendingSerialQueue_SerialNumber_Field, @@ -16039,7 +16039,7 @@ func (obj *cockroachImpl) ReplaceNoReturn_PendingSerialQueue(ctx context.Context } -func (obj *cockroachImpl) CreateNoReturn_ConsumedSerial(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_ConsumedSerial(ctx context.Context, consumed_serial_storage_node_id ConsumedSerial_StorageNodeId_Field, consumed_serial_serial_number ConsumedSerial_SerialNumber_Field, consumed_serial_expires_at ConsumedSerial_ExpiresAt_Field) ( @@ -16065,7 +16065,7 @@ func (obj *cockroachImpl) CreateNoReturn_ConsumedSerial(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_Revocation(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_Revocation(ctx context.Context, revocation_revoked Revocation_Revoked_Field, revocation_api_key_id Revocation_ApiKeyId_Field) ( err error) { @@ -16089,7 +16089,7 @@ func (obj *cockroachImpl) CreateNoReturn_Revocation(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_BucketStorageTally(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_BucketStorageTally(ctx context.Context, bucket_storage_tally_bucket_name BucketStorageTally_BucketName_Field, bucket_storage_tally_project_id BucketStorageTally_ProjectId_Field, bucket_storage_tally_interval_start BucketStorageTally_IntervalStart_Field, @@ -16127,7 +16127,7 @@ func (obj *cockroachImpl) CreateNoReturn_BucketStorageTally(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_StoragenodePaystub(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_StoragenodePaystub(ctx context.Context, storagenode_paystub_period StoragenodePaystub_Period_Field, storagenode_paystub_node_id StoragenodePaystub_NodeId_Field, storagenode_paystub_codes StoragenodePaystub_Codes_Field, @@ -16190,7 +16190,7 @@ func (obj *cockroachImpl) CreateNoReturn_StoragenodePaystub(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_StoragenodePayment(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_StoragenodePayment(ctx context.Context, storagenode_payment_node_id StoragenodePayment_NodeId_Field, storagenode_payment_period StoragenodePayment_Period_Field, storagenode_payment_amount StoragenodePayment_Amount_Field, @@ -16222,7 +16222,7 @@ func (obj *cockroachImpl) CreateNoReturn_StoragenodePayment(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_PeerIdentity(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_PeerIdentity(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field, peer_identity_leaf_serial_number PeerIdentity_LeafSerialNumber_Field, peer_identity_chain PeerIdentity_Chain_Field) ( @@ -16251,7 +16251,7 @@ func (obj *cockroachImpl) CreateNoReturn_PeerIdentity(ctx context.Context, } -func (obj *cockroachImpl) Create_RegistrationToken(ctx context.Context, +func (obj *pgxcockroachImpl) Create_RegistrationToken(ctx context.Context, registration_token_secret RegistrationToken_Secret_Field, registration_token_project_limit RegistrationToken_ProjectLimit_Field, optional RegistrationToken_Create_Fields) ( @@ -16281,7 +16281,7 @@ func (obj *cockroachImpl) Create_RegistrationToken(ctx context.Context, } -func (obj *cockroachImpl) Create_ResetPasswordToken(ctx context.Context, +func (obj *pgxcockroachImpl) Create_ResetPasswordToken(ctx context.Context, reset_password_token_secret ResetPasswordToken_Secret_Field, reset_password_token_owner_id ResetPasswordToken_OwnerId_Field) ( reset_password_token *ResetPasswordToken, err error) { @@ -16309,7 +16309,7 @@ func (obj *cockroachImpl) Create_ResetPasswordToken(ctx context.Context, } -func (obj *cockroachImpl) Create_Offer(ctx context.Context, +func (obj *pgxcockroachImpl) Create_Offer(ctx context.Context, offer_name Offer_Name_Field, offer_description Offer_Description_Field, offer_expires_at Offer_ExpiresAt_Field, @@ -16374,7 +16374,7 @@ func (obj *cockroachImpl) Create_Offer(ctx context.Context, } -func (obj *cockroachImpl) Create_UserCredit(ctx context.Context, +func (obj *pgxcockroachImpl) Create_UserCredit(ctx context.Context, user_credit_user_id UserCredit_UserId_Field, user_credit_offer_id UserCredit_OfferId_Field, user_credit_type UserCredit_Type_Field, @@ -16411,7 +16411,7 @@ func (obj *cockroachImpl) Create_UserCredit(ctx context.Context, } -func (obj *cockroachImpl) Create_BucketMetainfo(ctx context.Context, +func (obj *pgxcockroachImpl) Create_BucketMetainfo(ctx context.Context, bucket_metainfo_id BucketMetainfo_Id_Field, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field, @@ -16463,7 +16463,7 @@ func (obj *cockroachImpl) Create_BucketMetainfo(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_GracefulExitProgress(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_GracefulExitProgress(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field, graceful_exit_progress_bytes_transferred GracefulExitProgress_BytesTransferred_Field) ( err error) { @@ -16494,7 +16494,7 @@ func (obj *cockroachImpl) CreateNoReturn_GracefulExitProgress(ctx context.Contex } -func (obj *cockroachImpl) CreateNoReturn_GracefulExitTransferQueue(ctx context.Context, +func (obj *pgxcockroachImpl) CreateNoReturn_GracefulExitTransferQueue(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field, @@ -16553,7 +16553,7 @@ func (obj *cockroachImpl) CreateNoReturn_GracefulExitTransferQueue(ctx context.C } -func (obj *cockroachImpl) Create_NodesOfflineTime(ctx context.Context, +func (obj *pgxcockroachImpl) Create_NodesOfflineTime(ctx context.Context, nodes_offline_time_node_id NodesOfflineTime_NodeId_Field, nodes_offline_time_tracked_at NodesOfflineTime_TrackedAt_Field, nodes_offline_time_seconds NodesOfflineTime_Seconds_Field) ( @@ -16580,7 +16580,7 @@ func (obj *cockroachImpl) Create_NodesOfflineTime(ctx context.Context, } -func (obj *cockroachImpl) Create_StripeCustomer(ctx context.Context, +func (obj *pgxcockroachImpl) Create_StripeCustomer(ctx context.Context, stripe_customer_user_id StripeCustomer_UserId_Field, stripe_customer_customer_id StripeCustomer_CustomerId_Field) ( stripe_customer *StripeCustomer, err error) { @@ -16608,7 +16608,7 @@ func (obj *cockroachImpl) Create_StripeCustomer(ctx context.Context, } -func (obj *cockroachImpl) Create_CoinpaymentsTransaction(ctx context.Context, +func (obj *pgxcockroachImpl) Create_CoinpaymentsTransaction(ctx context.Context, coinpayments_transaction_id CoinpaymentsTransaction_Id_Field, coinpayments_transaction_user_id CoinpaymentsTransaction_UserId_Field, coinpayments_transaction_address CoinpaymentsTransaction_Address_Field, @@ -16648,7 +16648,7 @@ func (obj *cockroachImpl) Create_CoinpaymentsTransaction(ctx context.Context, } -func (obj *cockroachImpl) Create_StripecoinpaymentsApplyBalanceIntent(ctx context.Context, +func (obj *pgxcockroachImpl) Create_StripecoinpaymentsApplyBalanceIntent(ctx context.Context, stripecoinpayments_apply_balance_intent_tx_id StripecoinpaymentsApplyBalanceIntent_TxId_Field, stripecoinpayments_apply_balance_intent_state StripecoinpaymentsApplyBalanceIntent_State_Field) ( stripecoinpayments_apply_balance_intent *StripecoinpaymentsApplyBalanceIntent, err error) { @@ -16676,7 +16676,7 @@ func (obj *cockroachImpl) Create_StripecoinpaymentsApplyBalanceIntent(ctx contex } -func (obj *cockroachImpl) Create_StripecoinpaymentsInvoiceProjectRecord(ctx context.Context, +func (obj *pgxcockroachImpl) Create_StripecoinpaymentsInvoiceProjectRecord(ctx context.Context, stripecoinpayments_invoice_project_record_id StripecoinpaymentsInvoiceProjectRecord_Id_Field, stripecoinpayments_invoice_project_record_project_id StripecoinpaymentsInvoiceProjectRecord_ProjectId_Field, stripecoinpayments_invoice_project_record_storage StripecoinpaymentsInvoiceProjectRecord_Storage_Field, @@ -16716,7 +16716,7 @@ func (obj *cockroachImpl) Create_StripecoinpaymentsInvoiceProjectRecord(ctx cont } -func (obj *cockroachImpl) Create_StripecoinpaymentsTxConversionRate(ctx context.Context, +func (obj *pgxcockroachImpl) Create_StripecoinpaymentsTxConversionRate(ctx context.Context, stripecoinpayments_tx_conversion_rate_tx_id StripecoinpaymentsTxConversionRate_TxId_Field, stripecoinpayments_tx_conversion_rate_rate StripecoinpaymentsTxConversionRate_Rate_Field) ( stripecoinpayments_tx_conversion_rate *StripecoinpaymentsTxConversionRate, err error) { @@ -16744,7 +16744,7 @@ func (obj *cockroachImpl) Create_StripecoinpaymentsTxConversionRate(ctx context. } -func (obj *cockroachImpl) Create_Coupon(ctx context.Context, +func (obj *pgxcockroachImpl) Create_Coupon(ctx context.Context, coupon_id Coupon_Id_Field, coupon_user_id Coupon_UserId_Field, coupon_amount Coupon_Amount_Field, @@ -16782,7 +16782,7 @@ func (obj *cockroachImpl) Create_Coupon(ctx context.Context, } -func (obj *cockroachImpl) Create_CouponUsage(ctx context.Context, +func (obj *pgxcockroachImpl) Create_CouponUsage(ctx context.Context, coupon_usage_coupon_id CouponUsage_CouponId_Field, coupon_usage_amount CouponUsage_Amount_Field, coupon_usage_status CouponUsage_Status_Field, @@ -16811,7 +16811,7 @@ func (obj *cockroachImpl) Create_CouponUsage(ctx context.Context, } -func (obj *cockroachImpl) Create_Credit(ctx context.Context, +func (obj *pgxcockroachImpl) Create_Credit(ctx context.Context, credit_user_id Credit_UserId_Field, credit_transaction_id Credit_TransactionId_Field, credit_amount Credit_Amount_Field) ( @@ -16841,7 +16841,7 @@ func (obj *cockroachImpl) Create_Credit(ctx context.Context, } -func (obj *cockroachImpl) Create_CreditsSpending(ctx context.Context, +func (obj *pgxcockroachImpl) Create_CreditsSpending(ctx context.Context, credits_spending_id CreditsSpending_Id_Field, credits_spending_user_id CreditsSpending_UserId_Field, credits_spending_project_id CreditsSpending_ProjectId_Field, @@ -16877,7 +16877,7 @@ func (obj *cockroachImpl) Create_CreditsSpending(ctx context.Context, } -func (obj *cockroachImpl) CreateNoReturn_NodeApiVersion(ctx context.Context, +func (obj *pgxcockroachImpl) ReplaceNoReturn_NodeApiVersion(ctx context.Context, node_api_version_id NodeApiVersion_Id_Field, node_api_version_api_version NodeApiVersion_ApiVersion_Field) ( err error) { @@ -16889,7 +16889,7 @@ func (obj *cockroachImpl) CreateNoReturn_NodeApiVersion(ctx context.Context, __created_at_val := __now __updated_at_val := __now - var __embed_stmt = __sqlbundle_Literal("INSERT INTO node_api_versions ( id, api_version, created_at, updated_at ) VALUES ( ?, ?, ?, ? )") + var __embed_stmt = __sqlbundle_Literal("UPSERT INTO node_api_versions ( id, api_version, created_at, updated_at ) VALUES ( ?, ?, ?, ? )") var __values []interface{} __values = append(__values, __id_val, __api_version_val, __created_at_val, __updated_at_val) @@ -16905,7 +16905,7 @@ func (obj *cockroachImpl) CreateNoReturn_NodeApiVersion(ctx context.Context, } -func (obj *cockroachImpl) Get_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, +func (obj *pgxcockroachImpl) Get_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, value_attribution_project_id ValueAttribution_ProjectId_Field, value_attribution_bucket_name ValueAttribution_BucketName_Field) ( value_attribution *ValueAttribution, err error) { @@ -16928,7 +16928,7 @@ func (obj *cockroachImpl) Get_ValueAttribution_By_ProjectId_And_BucketName(ctx c } -func (obj *cockroachImpl) Get_PendingAudits_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_PendingAudits_By_NodeId(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field) ( pending_audits *PendingAudits, err error) { defer mon.Task()(&ctx)(&err) @@ -16950,7 +16950,7 @@ func (obj *cockroachImpl) Get_PendingAudits_By_NodeId(ctx context.Context, } -func (obj *cockroachImpl) Get_Irreparabledb_By_Segmentpath(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Irreparabledb_By_Segmentpath(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) ( irreparabledb *Irreparabledb, err error) { defer mon.Task()(&ctx)(&err) @@ -16972,7 +16972,7 @@ func (obj *cockroachImpl) Get_Irreparabledb_By_Segmentpath(ctx context.Context, } -func (obj *cockroachImpl) Limited_Irreparabledb_By_Segmentpath_Greater_OrderBy_Asc_Segmentpath(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_Irreparabledb_By_Segmentpath_Greater_OrderBy_Asc_Segmentpath(ctx context.Context, irreparabledb_segmentpath_greater Irreparabledb_Segmentpath_Field, limit int, offset int64) ( rows []*Irreparabledb, err error) { @@ -17009,7 +17009,7 @@ func (obj *cockroachImpl) Limited_Irreparabledb_By_Segmentpath_Greater_OrderBy_A } -func (obj *cockroachImpl) Find_AccountingTimestamps_Value_By_Name(ctx context.Context, +func (obj *pgxcockroachImpl) Find_AccountingTimestamps_Value_By_Name(ctx context.Context, accounting_timestamps_name AccountingTimestamps_Name_Field) ( row *Value_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -17034,7 +17034,7 @@ func (obj *cockroachImpl) Find_AccountingTimestamps_Value_By_Name(ctx context.Co } -func (obj *cockroachImpl) Get_AccountingRollup_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_AccountingRollup_By_Id(ctx context.Context, accounting_rollup_id AccountingRollup_Id_Field) ( accounting_rollup *AccountingRollup, err error) { defer mon.Task()(&ctx)(&err) @@ -17056,7 +17056,7 @@ func (obj *cockroachImpl) Get_AccountingRollup_By_Id(ctx context.Context, } -func (obj *cockroachImpl) All_AccountingRollup_By_StartTime_GreaterOrEqual(ctx context.Context, +func (obj *pgxcockroachImpl) All_AccountingRollup_By_StartTime_GreaterOrEqual(ctx context.Context, accounting_rollup_start_time_greater_or_equal AccountingRollup_StartTime_Field) ( rows []*AccountingRollup, err error) { defer mon.Task()(&ctx)(&err) @@ -17090,7 +17090,7 @@ func (obj *cockroachImpl) All_AccountingRollup_By_StartTime_GreaterOrEqual(ctx c } -func (obj *cockroachImpl) Get_Node_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Node_By_Id(ctx context.Context, node_id Node_Id_Field) ( node *Node, err error) { defer mon.Task()(&ctx)(&err) @@ -17112,7 +17112,7 @@ func (obj *cockroachImpl) Get_Node_By_Id(ctx context.Context, } -func (obj *cockroachImpl) All_Node_Id(ctx context.Context) ( +func (obj *pgxcockroachImpl) All_Node_Id(ctx context.Context) ( rows []*Id_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -17144,7 +17144,7 @@ func (obj *cockroachImpl) All_Node_Id(ctx context.Context) ( } -func (obj *cockroachImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx context.Context, node_id_greater_or_equal Node_Id_Field, limit int, offset int64) ( rows []*Node, err error) { @@ -17181,7 +17181,7 @@ func (obj *cockroachImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx c } -func (obj *cockroachImpl) All_Node_Id_Node_PieceCount_By_PieceCount_Not_Number(ctx context.Context) ( +func (obj *pgxcockroachImpl) All_Node_Id_Node_PieceCount_By_PieceCount_Not_Number(ctx context.Context) ( rows []*Id_PieceCount_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -17213,7 +17213,7 @@ func (obj *cockroachImpl) All_Node_Id_Node_PieceCount_By_PieceCount_Not_Number(c } -func (obj *cockroachImpl) Limited_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactFailure(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactFailure(ctx context.Context, limit int, offset int64) ( rows []*Id_Address_LastIpPort_LastContactSuccess_LastContactFailure_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -17248,7 +17248,7 @@ func (obj *cockroachImpl) Limited_Node_Id_Node_Address_Node_LastIpPort_Node_Last } -func (obj *cockroachImpl) All_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_And_LastContactSuccess_Greater_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactSuccess(ctx context.Context, +func (obj *pgxcockroachImpl) All_Node_Id_Node_Address_Node_LastIpPort_Node_LastContactSuccess_Node_LastContactFailure_By_LastContactSuccess_Less_And_LastContactSuccess_Greater_LastContactFailure_And_Disqualified_Is_Null_OrderBy_Asc_LastContactSuccess(ctx context.Context, node_last_contact_success_less Node_LastContactSuccess_Field) ( rows []*Id_Address_LastIpPort_LastContactSuccess_LastContactFailure_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -17282,7 +17282,7 @@ func (obj *cockroachImpl) All_Node_Id_Node_Address_Node_LastIpPort_Node_LastCont } -func (obj *cockroachImpl) Get_AuditHistory_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_AuditHistory_By_NodeId(ctx context.Context, audit_history_node_id AuditHistory_NodeId_Field) ( audit_history *AuditHistory, err error) { defer mon.Task()(&ctx)(&err) @@ -17304,7 +17304,7 @@ func (obj *cockroachImpl) Get_AuditHistory_By_NodeId(ctx context.Context, } -func (obj *cockroachImpl) Get_User_By_NormalizedEmail_And_Status_Not_Number(ctx context.Context, +func (obj *pgxcockroachImpl) Get_User_By_NormalizedEmail_And_Status_Not_Number(ctx context.Context, user_normalized_email User_NormalizedEmail_Field) ( user *User, err error) { defer mon.Task()(&ctx)(&err) @@ -17348,7 +17348,7 @@ func (obj *cockroachImpl) Get_User_By_NormalizedEmail_And_Status_Not_Number(ctx } -func (obj *cockroachImpl) Get_User_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_User_By_Id(ctx context.Context, user_id User_Id_Field) ( user *User, err error) { defer mon.Task()(&ctx)(&err) @@ -17370,7 +17370,7 @@ func (obj *cockroachImpl) Get_User_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Get_Project_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Project_By_Id(ctx context.Context, project_id Project_Id_Field) ( project *Project, err error) { defer mon.Task()(&ctx)(&err) @@ -17392,7 +17392,7 @@ func (obj *cockroachImpl) Get_Project_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Get_Project_UsageLimit_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Project_UsageLimit_By_Id(ctx context.Context, project_id Project_Id_Field) ( row *UsageLimit_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -17414,7 +17414,7 @@ func (obj *cockroachImpl) Get_Project_UsageLimit_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Get_Project_BandwidthLimit_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Project_BandwidthLimit_By_Id(ctx context.Context, project_id Project_Id_Field) ( row *BandwidthLimit_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -17436,7 +17436,7 @@ func (obj *cockroachImpl) Get_Project_BandwidthLimit_By_Id(ctx context.Context, } -func (obj *cockroachImpl) All_Project(ctx context.Context) ( +func (obj *pgxcockroachImpl) All_Project(ctx context.Context) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -17468,7 +17468,7 @@ func (obj *cockroachImpl) All_Project(ctx context.Context) ( } -func (obj *cockroachImpl) All_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, project_created_at_less Project_CreatedAt_Field) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -17502,7 +17502,7 @@ func (obj *cockroachImpl) All_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ct } -func (obj *cockroachImpl) All_Project_By_OwnerId_OrderBy_Asc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_Project_By_OwnerId_OrderBy_Asc_CreatedAt(ctx context.Context, project_owner_id Project_OwnerId_Field) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -17536,7 +17536,7 @@ func (obj *cockroachImpl) All_Project_By_OwnerId_OrderBy_Asc_CreatedAt(ctx conte } -func (obj *cockroachImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Project_Name(ctx context.Context, +func (obj *pgxcockroachImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Project_Name(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field) ( rows []*Project, err error) { defer mon.Task()(&ctx)(&err) @@ -17570,7 +17570,7 @@ func (obj *cockroachImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Proj } -func (obj *cockroachImpl) Limited_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedAt(ctx context.Context, project_created_at_less Project_CreatedAt_Field, limit int, offset int64) ( rows []*Project, err error) { @@ -17607,7 +17607,7 @@ func (obj *cockroachImpl) Limited_Project_By_CreatedAt_Less_OrderBy_Asc_CreatedA } -func (obj *cockroachImpl) Get_ProjectInvoiceStamp_By_ProjectId_And_StartDate(ctx context.Context, +func (obj *pgxcockroachImpl) Get_ProjectInvoiceStamp_By_ProjectId_And_StartDate(ctx context.Context, project_invoice_stamp_project_id ProjectInvoiceStamp_ProjectId_Field, project_invoice_stamp_start_date ProjectInvoiceStamp_StartDate_Field) ( project_invoice_stamp *ProjectInvoiceStamp, err error) { @@ -17652,7 +17652,7 @@ func (obj *cockroachImpl) Get_ProjectInvoiceStamp_By_ProjectId_And_StartDate(ctx } -func (obj *cockroachImpl) All_ProjectInvoiceStamp_By_ProjectId_OrderBy_Desc_StartDate(ctx context.Context, +func (obj *pgxcockroachImpl) All_ProjectInvoiceStamp_By_ProjectId_OrderBy_Desc_StartDate(ctx context.Context, project_invoice_stamp_project_id ProjectInvoiceStamp_ProjectId_Field) ( rows []*ProjectInvoiceStamp, err error) { defer mon.Task()(&ctx)(&err) @@ -17686,7 +17686,7 @@ func (obj *cockroachImpl) All_ProjectInvoiceStamp_By_ProjectId_OrderBy_Desc_Star } -func (obj *cockroachImpl) All_ProjectMember_By_MemberId(ctx context.Context, +func (obj *pgxcockroachImpl) All_ProjectMember_By_MemberId(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field) ( rows []*ProjectMember, err error) { defer mon.Task()(&ctx)(&err) @@ -17720,7 +17720,7 @@ func (obj *cockroachImpl) All_ProjectMember_By_MemberId(ctx context.Context, } -func (obj *cockroachImpl) Limited_ProjectMember_By_ProjectId(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_ProjectMember_By_ProjectId(ctx context.Context, project_member_project_id ProjectMember_ProjectId_Field, limit int, offset int64) ( rows []*ProjectMember, err error) { @@ -17757,7 +17757,7 @@ func (obj *cockroachImpl) Limited_ProjectMember_By_ProjectId(ctx context.Context } -func (obj *cockroachImpl) Get_ApiKey_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_ApiKey_By_Id(ctx context.Context, api_key_id ApiKey_Id_Field) ( api_key *ApiKey, err error) { defer mon.Task()(&ctx)(&err) @@ -17779,7 +17779,7 @@ func (obj *cockroachImpl) Get_ApiKey_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Get_ApiKey_By_Head(ctx context.Context, +func (obj *pgxcockroachImpl) Get_ApiKey_By_Head(ctx context.Context, api_key_head ApiKey_Head_Field) ( api_key *ApiKey, err error) { defer mon.Task()(&ctx)(&err) @@ -17801,7 +17801,7 @@ func (obj *cockroachImpl) Get_ApiKey_By_Head(ctx context.Context, } -func (obj *cockroachImpl) Get_ApiKey_By_Name_And_ProjectId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_ApiKey_By_Name_And_ProjectId(ctx context.Context, api_key_name ApiKey_Name_Field, api_key_project_id ApiKey_ProjectId_Field) ( api_key *ApiKey, err error) { @@ -17824,7 +17824,7 @@ func (obj *cockroachImpl) Get_ApiKey_By_Name_And_ProjectId(ctx context.Context, } -func (obj *cockroachImpl) All_ApiKey_By_ProjectId_OrderBy_Asc_Name(ctx context.Context, +func (obj *pgxcockroachImpl) All_ApiKey_By_ProjectId_OrderBy_Asc_Name(ctx context.Context, api_key_project_id ApiKey_ProjectId_Field) ( rows []*ApiKey, err error) { defer mon.Task()(&ctx)(&err) @@ -17858,7 +17858,7 @@ func (obj *cockroachImpl) All_ApiKey_By_ProjectId_OrderBy_Asc_Name(ctx context.C } -func (obj *cockroachImpl) Find_SerialNumber_By_SerialNumber(ctx context.Context, +func (obj *pgxcockroachImpl) Find_SerialNumber_By_SerialNumber(ctx context.Context, serial_number_serial_number SerialNumber_SerialNumber_Field) ( serial_number *SerialNumber, err error) { defer mon.Task()(&ctx)(&err) @@ -17902,7 +17902,7 @@ func (obj *cockroachImpl) Find_SerialNumber_By_SerialNumber(ctx context.Context, } -func (obj *cockroachImpl) Paged_PendingSerialQueue(ctx context.Context, +func (obj *pgxcockroachImpl) Paged_PendingSerialQueue(ctx context.Context, limit int, start *Paged_PendingSerialQueue_Continuation) ( rows []*PendingSerialQueue, next *Paged_PendingSerialQueue_Continuation, err error) { defer mon.Task()(&ctx)(&err) @@ -17949,7 +17949,7 @@ func (obj *cockroachImpl) Paged_PendingSerialQueue(ctx context.Context, } -func (obj *cockroachImpl) Has_ConsumedSerial_By_StorageNodeId_And_SerialNumber(ctx context.Context, +func (obj *pgxcockroachImpl) Has_ConsumedSerial_By_StorageNodeId_And_SerialNumber(ctx context.Context, consumed_serial_storage_node_id ConsumedSerial_StorageNodeId_Field, consumed_serial_serial_number ConsumedSerial_SerialNumber_Field) ( has bool, err error) { @@ -17971,7 +17971,7 @@ func (obj *cockroachImpl) Has_ConsumedSerial_By_StorageNodeId_And_SerialNumber(c } -func (obj *cockroachImpl) Find_BucketBandwidthRollup_By_BucketName_And_ProjectId_And_IntervalStart_And_Action(ctx context.Context, +func (obj *pgxcockroachImpl) Find_BucketBandwidthRollup_By_BucketName_And_ProjectId_And_IntervalStart_And_Action(ctx context.Context, bucket_bandwidth_rollup_bucket_name BucketBandwidthRollup_BucketName_Field, bucket_bandwidth_rollup_project_id BucketBandwidthRollup_ProjectId_Field, bucket_bandwidth_rollup_interval_start BucketBandwidthRollup_IntervalStart_Field, @@ -17999,7 +17999,7 @@ func (obj *cockroachImpl) Find_BucketBandwidthRollup_By_BucketName_And_ProjectId } -func (obj *cockroachImpl) Find_ProjectBandwidthRollup_By_ProjectId_And_IntervalMonth(ctx context.Context, +func (obj *pgxcockroachImpl) Find_ProjectBandwidthRollup_By_ProjectId_And_IntervalMonth(ctx context.Context, project_bandwidth_rollup_project_id ProjectBandwidthRollup_ProjectId_Field, project_bandwidth_rollup_interval_month ProjectBandwidthRollup_IntervalMonth_Field) ( project_bandwidth_rollup *ProjectBandwidthRollup, err error) { @@ -18025,7 +18025,7 @@ func (obj *cockroachImpl) Find_ProjectBandwidthRollup_By_ProjectId_And_IntervalM } -func (obj *cockroachImpl) First_BucketStorageTally_By_ProjectId_OrderBy_Desc_IntervalStart(ctx context.Context, +func (obj *pgxcockroachImpl) First_BucketStorageTally_By_ProjectId_OrderBy_Desc_IntervalStart(ctx context.Context, bucket_storage_tally_project_id BucketStorageTally_ProjectId_Field) ( bucket_storage_tally *BucketStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -18061,7 +18061,7 @@ func (obj *cockroachImpl) First_BucketStorageTally_By_ProjectId_OrderBy_Desc_Int } -func (obj *cockroachImpl) All_BucketStorageTally(ctx context.Context) ( +func (obj *pgxcockroachImpl) All_BucketStorageTally(ctx context.Context) ( rows []*BucketStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -18093,7 +18093,7 @@ func (obj *cockroachImpl) All_BucketStorageTally(ctx context.Context) ( } -func (obj *cockroachImpl) All_BucketStorageTally_By_ProjectId_And_BucketName_And_IntervalStart_GreaterOrEqual_And_IntervalStart_LessOrEqual_OrderBy_Desc_IntervalStart(ctx context.Context, +func (obj *pgxcockroachImpl) All_BucketStorageTally_By_ProjectId_And_BucketName_And_IntervalStart_GreaterOrEqual_And_IntervalStart_LessOrEqual_OrderBy_Desc_IntervalStart(ctx context.Context, bucket_storage_tally_project_id BucketStorageTally_ProjectId_Field, bucket_storage_tally_bucket_name BucketStorageTally_BucketName_Field, bucket_storage_tally_interval_start_greater_or_equal BucketStorageTally_IntervalStart_Field, @@ -18130,7 +18130,7 @@ func (obj *cockroachImpl) All_BucketStorageTally_By_ProjectId_And_BucketName_And } -func (obj *cockroachImpl) Find_StoragenodeBandwidthRollup_By_StoragenodeId_And_IntervalStart_And_Action(ctx context.Context, +func (obj *pgxcockroachImpl) Find_StoragenodeBandwidthRollup_By_StoragenodeId_And_IntervalStart_And_Action(ctx context.Context, storagenode_bandwidth_rollup_storagenode_id StoragenodeBandwidthRollup_StoragenodeId_Field, storagenode_bandwidth_rollup_interval_start StoragenodeBandwidthRollup_IntervalStart_Field, storagenode_bandwidth_rollup_action StoragenodeBandwidthRollup_Action_Field) ( @@ -18157,7 +18157,7 @@ func (obj *cockroachImpl) Find_StoragenodeBandwidthRollup_By_StoragenodeId_And_I } -func (obj *cockroachImpl) All_StoragenodeBandwidthRollup_By_IntervalStart_GreaterOrEqual(ctx context.Context, +func (obj *pgxcockroachImpl) All_StoragenodeBandwidthRollup_By_IntervalStart_GreaterOrEqual(ctx context.Context, storagenode_bandwidth_rollup_interval_start_greater_or_equal StoragenodeBandwidthRollup_IntervalStart_Field) ( rows []*StoragenodeBandwidthRollup, err error) { defer mon.Task()(&ctx)(&err) @@ -18191,7 +18191,7 @@ func (obj *cockroachImpl) All_StoragenodeBandwidthRollup_By_IntervalStart_Greate } -func (obj *cockroachImpl) All_StoragenodeStorageTally(ctx context.Context) ( +func (obj *pgxcockroachImpl) All_StoragenodeStorageTally(ctx context.Context) ( rows []*StoragenodeStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -18223,7 +18223,7 @@ func (obj *cockroachImpl) All_StoragenodeStorageTally(ctx context.Context) ( } -func (obj *cockroachImpl) All_StoragenodeStorageTally_By_IntervalEndTime_GreaterOrEqual(ctx context.Context, +func (obj *pgxcockroachImpl) All_StoragenodeStorageTally_By_IntervalEndTime_GreaterOrEqual(ctx context.Context, storagenode_storage_tally_interval_end_time_greater_or_equal StoragenodeStorageTally_IntervalEndTime_Field) ( rows []*StoragenodeStorageTally, err error) { defer mon.Task()(&ctx)(&err) @@ -18257,7 +18257,7 @@ func (obj *cockroachImpl) All_StoragenodeStorageTally_By_IntervalEndTime_Greater } -func (obj *cockroachImpl) Get_PeerIdentity_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_PeerIdentity_By_NodeId(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field) ( peer_identity *PeerIdentity, err error) { defer mon.Task()(&ctx)(&err) @@ -18279,7 +18279,7 @@ func (obj *cockroachImpl) Get_PeerIdentity_By_NodeId(ctx context.Context, } -func (obj *cockroachImpl) Get_PeerIdentity_LeafSerialNumber_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_PeerIdentity_LeafSerialNumber_By_NodeId(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field) ( row *LeafSerialNumber_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -18301,7 +18301,7 @@ func (obj *cockroachImpl) Get_PeerIdentity_LeafSerialNumber_By_NodeId(ctx contex } -func (obj *cockroachImpl) Get_RegistrationToken_By_Secret(ctx context.Context, +func (obj *pgxcockroachImpl) Get_RegistrationToken_By_Secret(ctx context.Context, registration_token_secret RegistrationToken_Secret_Field) ( registration_token *RegistrationToken, err error) { defer mon.Task()(&ctx)(&err) @@ -18323,7 +18323,7 @@ func (obj *cockroachImpl) Get_RegistrationToken_By_Secret(ctx context.Context, } -func (obj *cockroachImpl) Get_RegistrationToken_By_OwnerId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_RegistrationToken_By_OwnerId(ctx context.Context, registration_token_owner_id RegistrationToken_OwnerId_Field) ( registration_token *RegistrationToken, err error) { defer mon.Task()(&ctx)(&err) @@ -18350,7 +18350,7 @@ func (obj *cockroachImpl) Get_RegistrationToken_By_OwnerId(ctx context.Context, } -func (obj *cockroachImpl) Get_ResetPasswordToken_By_Secret(ctx context.Context, +func (obj *pgxcockroachImpl) Get_ResetPasswordToken_By_Secret(ctx context.Context, reset_password_token_secret ResetPasswordToken_Secret_Field) ( reset_password_token *ResetPasswordToken, err error) { defer mon.Task()(&ctx)(&err) @@ -18372,7 +18372,7 @@ func (obj *cockroachImpl) Get_ResetPasswordToken_By_Secret(ctx context.Context, } -func (obj *cockroachImpl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context, reset_password_token_owner_id ResetPasswordToken_OwnerId_Field) ( reset_password_token *ResetPasswordToken, err error) { defer mon.Task()(&ctx)(&err) @@ -18394,7 +18394,7 @@ func (obj *cockroachImpl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context, } -func (obj *cockroachImpl) Get_Offer_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Offer_By_Id(ctx context.Context, offer_id Offer_Id_Field) ( offer *Offer, err error) { defer mon.Task()(&ctx)(&err) @@ -18416,7 +18416,7 @@ func (obj *cockroachImpl) Get_Offer_By_Id(ctx context.Context, } -func (obj *cockroachImpl) All_Offer_OrderBy_Asc_Id(ctx context.Context) ( +func (obj *pgxcockroachImpl) All_Offer_OrderBy_Asc_Id(ctx context.Context) ( rows []*Offer, err error) { defer mon.Task()(&ctx)(&err) @@ -18448,7 +18448,7 @@ func (obj *cockroachImpl) All_Offer_OrderBy_Asc_Id(ctx context.Context) ( } -func (obj *cockroachImpl) All_UserCredit_By_UserId_And_ExpiresAt_Greater_And_CreditsUsedInCents_Less_CreditsEarnedInCents_OrderBy_Asc_ExpiresAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_UserCredit_By_UserId_And_ExpiresAt_Greater_And_CreditsUsedInCents_Less_CreditsEarnedInCents_OrderBy_Asc_ExpiresAt(ctx context.Context, user_credit_user_id UserCredit_UserId_Field, user_credit_expires_at_greater UserCredit_ExpiresAt_Field) ( rows []*UserCredit, err error) { @@ -18483,7 +18483,7 @@ func (obj *cockroachImpl) All_UserCredit_By_UserId_And_ExpiresAt_Greater_And_Cre } -func (obj *cockroachImpl) Count_UserCredit_By_ReferredBy(ctx context.Context, +func (obj *pgxcockroachImpl) Count_UserCredit_By_ReferredBy(ctx context.Context, user_credit_referred_by UserCredit_ReferredBy_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -18510,7 +18510,7 @@ func (obj *cockroachImpl) Count_UserCredit_By_ReferredBy(ctx context.Context, } -func (obj *cockroachImpl) Get_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, +func (obj *pgxcockroachImpl) Get_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field) ( bucket_metainfo *BucketMetainfo, err error) { @@ -18533,7 +18533,7 @@ func (obj *cockroachImpl) Get_BucketMetainfo_By_ProjectId_And_Name(ctx context.C } -func (obj *cockroachImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_GreaterOrEqual_OrderBy_Asc_Name(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_GreaterOrEqual_OrderBy_Asc_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name_greater_or_equal BucketMetainfo_Name_Field, limit int, offset int64) ( @@ -18571,7 +18571,7 @@ func (obj *cockroachImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_GreaterOr } -func (obj *cockroachImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_Greater_OrderBy_Asc_Name(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_Greater_OrderBy_Asc_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name_greater BucketMetainfo_Name_Field, limit int, offset int64) ( @@ -18609,7 +18609,7 @@ func (obj *cockroachImpl) Limited_BucketMetainfo_By_ProjectId_And_Name_Greater_O } -func (obj *cockroachImpl) Get_GracefulExitProgress_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_GracefulExitProgress_By_NodeId(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field) ( graceful_exit_progress *GracefulExitProgress, err error) { defer mon.Task()(&ctx)(&err) @@ -18631,7 +18631,7 @@ func (obj *cockroachImpl) Get_GracefulExitProgress_By_NodeId(ctx context.Context } -func (obj *cockroachImpl) Get_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, +func (obj *pgxcockroachImpl) Get_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field) ( @@ -18655,7 +18655,7 @@ func (obj *cockroachImpl) Get_GracefulExitTransferQueue_By_NodeId_And_Path_And_P } -func (obj *cockroachImpl) All_NodesOfflineTime_By_NodeId_And_TrackedAt_Greater_And_TrackedAt_LessOrEqual(ctx context.Context, +func (obj *pgxcockroachImpl) All_NodesOfflineTime_By_NodeId_And_TrackedAt_Greater_And_TrackedAt_LessOrEqual(ctx context.Context, nodes_offline_time_node_id NodesOfflineTime_NodeId_Field, nodes_offline_time_tracked_at_greater NodesOfflineTime_TrackedAt_Field, nodes_offline_time_tracked_at_less_or_equal NodesOfflineTime_TrackedAt_Field) ( @@ -18691,7 +18691,7 @@ func (obj *cockroachImpl) All_NodesOfflineTime_By_NodeId_And_TrackedAt_Greater_A } -func (obj *cockroachImpl) Get_StripeCustomer_CustomerId_By_UserId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_StripeCustomer_CustomerId_By_UserId(ctx context.Context, stripe_customer_user_id StripeCustomer_UserId_Field) ( row *CustomerId_Row, err error) { defer mon.Task()(&ctx)(&err) @@ -18713,7 +18713,7 @@ func (obj *cockroachImpl) Get_StripeCustomer_CustomerId_By_UserId(ctx context.Co } -func (obj *cockroachImpl) Limited_StripeCustomer_By_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_StripeCustomer_By_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, stripe_customer_created_at_less_or_equal StripeCustomer_CreatedAt_Field, limit int, offset int64) ( rows []*StripeCustomer, err error) { @@ -18750,7 +18750,7 @@ func (obj *cockroachImpl) Limited_StripeCustomer_By_CreatedAt_LessOrEqual_OrderB } -func (obj *cockroachImpl) All_CoinpaymentsTransaction_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_CoinpaymentsTransaction_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, coinpayments_transaction_user_id CoinpaymentsTransaction_UserId_Field) ( rows []*CoinpaymentsTransaction, err error) { defer mon.Task()(&ctx)(&err) @@ -18784,7 +18784,7 @@ func (obj *cockroachImpl) All_CoinpaymentsTransaction_By_UserId_OrderBy_Desc_Cre } -func (obj *cockroachImpl) Limited_CoinpaymentsTransaction_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_CoinpaymentsTransaction_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coinpayments_transaction_created_at_less_or_equal CoinpaymentsTransaction_CreatedAt_Field, coinpayments_transaction_status CoinpaymentsTransaction_Status_Field, limit int, offset int64) ( @@ -18822,7 +18822,7 @@ func (obj *cockroachImpl) Limited_CoinpaymentsTransaction_By_CreatedAt_LessOrEqu } -func (obj *cockroachImpl) Get_StripecoinpaymentsInvoiceProjectRecord_By_ProjectId_And_PeriodStart_And_PeriodEnd(ctx context.Context, +func (obj *pgxcockroachImpl) Get_StripecoinpaymentsInvoiceProjectRecord_By_ProjectId_And_PeriodStart_And_PeriodEnd(ctx context.Context, stripecoinpayments_invoice_project_record_project_id StripecoinpaymentsInvoiceProjectRecord_ProjectId_Field, stripecoinpayments_invoice_project_record_period_start StripecoinpaymentsInvoiceProjectRecord_PeriodStart_Field, stripecoinpayments_invoice_project_record_period_end StripecoinpaymentsInvoiceProjectRecord_PeriodEnd_Field) ( @@ -18846,7 +18846,7 @@ func (obj *cockroachImpl) Get_StripecoinpaymentsInvoiceProjectRecord_By_ProjectI } -func (obj *cockroachImpl) Limited_StripecoinpaymentsInvoiceProjectRecord_By_PeriodStart_And_PeriodEnd_And_State(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_StripecoinpaymentsInvoiceProjectRecord_By_PeriodStart_And_PeriodEnd_And_State(ctx context.Context, stripecoinpayments_invoice_project_record_period_start StripecoinpaymentsInvoiceProjectRecord_PeriodStart_Field, stripecoinpayments_invoice_project_record_period_end StripecoinpaymentsInvoiceProjectRecord_PeriodEnd_Field, stripecoinpayments_invoice_project_record_state StripecoinpaymentsInvoiceProjectRecord_State_Field, @@ -18885,7 +18885,7 @@ func (obj *cockroachImpl) Limited_StripecoinpaymentsInvoiceProjectRecord_By_Peri } -func (obj *cockroachImpl) Get_StripecoinpaymentsTxConversionRate_By_TxId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_StripecoinpaymentsTxConversionRate_By_TxId(ctx context.Context, stripecoinpayments_tx_conversion_rate_tx_id StripecoinpaymentsTxConversionRate_TxId_Field) ( stripecoinpayments_tx_conversion_rate *StripecoinpaymentsTxConversionRate, err error) { defer mon.Task()(&ctx)(&err) @@ -18907,7 +18907,7 @@ func (obj *cockroachImpl) Get_StripecoinpaymentsTxConversionRate_By_TxId(ctx con } -func (obj *cockroachImpl) Get_Coupon_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Coupon_By_Id(ctx context.Context, coupon_id Coupon_Id_Field) ( coupon *Coupon, err error) { defer mon.Task()(&ctx)(&err) @@ -18929,7 +18929,7 @@ func (obj *cockroachImpl) Get_Coupon_By_Id(ctx context.Context, } -func (obj *cockroachImpl) All_Coupon_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_Coupon_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_user_id Coupon_UserId_Field) ( rows []*Coupon, err error) { defer mon.Task()(&ctx)(&err) @@ -18963,7 +18963,7 @@ func (obj *cockroachImpl) All_Coupon_By_UserId_OrderBy_Desc_CreatedAt(ctx contex } -func (obj *cockroachImpl) All_Coupon_By_UserId_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_Coupon_By_UserId_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_user_id Coupon_UserId_Field, coupon_status Coupon_Status_Field) ( rows []*Coupon, err error) { @@ -18998,7 +18998,7 @@ func (obj *cockroachImpl) All_Coupon_By_UserId_And_Status_OrderBy_Desc_CreatedAt } -func (obj *cockroachImpl) All_Coupon_By_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_Coupon_By_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_status Coupon_Status_Field) ( rows []*Coupon, err error) { defer mon.Task()(&ctx)(&err) @@ -19032,7 +19032,7 @@ func (obj *cockroachImpl) All_Coupon_By_Status_OrderBy_Desc_CreatedAt(ctx contex } -func (obj *cockroachImpl) Limited_Coupon_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_Coupon_By_CreatedAt_LessOrEqual_And_Status_OrderBy_Desc_CreatedAt(ctx context.Context, coupon_created_at_less_or_equal Coupon_CreatedAt_Field, coupon_status Coupon_Status_Field, limit int, offset int64) ( @@ -19070,7 +19070,7 @@ func (obj *cockroachImpl) Limited_Coupon_By_CreatedAt_LessOrEqual_And_Status_Ord } -func (obj *cockroachImpl) Limited_CouponUsage_By_Period_And_Status_Equal_Number(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_CouponUsage_By_Period_And_Status_Equal_Number(ctx context.Context, coupon_usage_period CouponUsage_Period_Field, limit int, offset int64) ( rows []*CouponUsage, err error) { @@ -19107,7 +19107,7 @@ func (obj *cockroachImpl) Limited_CouponUsage_By_Period_And_Status_Equal_Number( } -func (obj *cockroachImpl) Get_Credit_By_TransactionId(ctx context.Context, +func (obj *pgxcockroachImpl) Get_Credit_By_TransactionId(ctx context.Context, credit_transaction_id Credit_TransactionId_Field) ( credit *Credit, err error) { defer mon.Task()(&ctx)(&err) @@ -19129,7 +19129,7 @@ func (obj *cockroachImpl) Get_Credit_By_TransactionId(ctx context.Context, } -func (obj *cockroachImpl) All_Credit_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_Credit_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, credit_user_id Credit_UserId_Field) ( rows []*Credit, err error) { defer mon.Task()(&ctx)(&err) @@ -19163,7 +19163,7 @@ func (obj *cockroachImpl) All_Credit_By_UserId_OrderBy_Desc_CreatedAt(ctx contex } -func (obj *cockroachImpl) Limited_Credit_By_UserId_And_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_Credit_By_UserId_And_CreatedAt_LessOrEqual_OrderBy_Desc_CreatedAt(ctx context.Context, credit_user_id Credit_UserId_Field, credit_created_at_less_or_equal Credit_CreatedAt_Field, limit int, offset int64) ( @@ -19201,7 +19201,7 @@ func (obj *cockroachImpl) Limited_Credit_By_UserId_And_CreatedAt_LessOrEqual_Ord } -func (obj *cockroachImpl) All_CreditsSpending_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, +func (obj *pgxcockroachImpl) All_CreditsSpending_By_UserId_OrderBy_Desc_CreatedAt(ctx context.Context, credits_spending_user_id CreditsSpending_UserId_Field) ( rows []*CreditsSpending, err error) { defer mon.Task()(&ctx)(&err) @@ -19235,7 +19235,7 @@ func (obj *cockroachImpl) All_CreditsSpending_By_UserId_OrderBy_Desc_CreatedAt(c } -func (obj *cockroachImpl) Limited_CreditsSpending_By_Period_And_Status(ctx context.Context, +func (obj *pgxcockroachImpl) Limited_CreditsSpending_By_Period_And_Status(ctx context.Context, credits_spending_period CreditsSpending_Period_Field, credits_spending_status CreditsSpending_Status_Field, limit int, offset int64) ( @@ -19273,7 +19273,7 @@ func (obj *cockroachImpl) Limited_CreditsSpending_By_Period_And_Status(ctx conte } -func (obj *cockroachImpl) Has_NodeApiVersion_By_Id_And_ApiVersion_GreaterOrEqual(ctx context.Context, +func (obj *pgxcockroachImpl) Has_NodeApiVersion_By_Id_And_ApiVersion_GreaterOrEqual(ctx context.Context, node_api_version_id NodeApiVersion_Id_Field, node_api_version_api_version_greater_or_equal NodeApiVersion_ApiVersion_Field) ( has bool, err error) { @@ -19295,7 +19295,7 @@ func (obj *cockroachImpl) Has_NodeApiVersion_By_Id_And_ApiVersion_GreaterOrEqual } -func (obj *cockroachImpl) Update_PendingAudits_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Update_PendingAudits_By_NodeId(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field, update PendingAudits_Update_Fields) ( pending_audits *PendingAudits, err error) { @@ -19336,7 +19336,7 @@ func (obj *cockroachImpl) Update_PendingAudits_By_NodeId(ctx context.Context, return pending_audits, nil } -func (obj *cockroachImpl) UpdateNoReturn_Irreparabledb_By_Segmentpath(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_Irreparabledb_By_Segmentpath(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field, update Irreparabledb_Update_Fields) ( err error) { @@ -19388,7 +19388,7 @@ func (obj *cockroachImpl) UpdateNoReturn_Irreparabledb_By_Segmentpath(ctx contex return nil } -func (obj *cockroachImpl) UpdateNoReturn_AccountingTimestamps_By_Name(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_AccountingTimestamps_By_Name(ctx context.Context, accounting_timestamps_name AccountingTimestamps_Name_Field, update AccountingTimestamps_Update_Fields) ( err error) { @@ -19425,7 +19425,7 @@ func (obj *cockroachImpl) UpdateNoReturn_AccountingTimestamps_By_Name(ctx contex return nil } -func (obj *cockroachImpl) Update_Node_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Update_Node_By_Id(ctx context.Context, node_id Node_Id_Field, update Node_Update_Fields) ( node *Node, err error) { @@ -19657,7 +19657,7 @@ func (obj *cockroachImpl) Update_Node_By_Id(ctx context.Context, return node, nil } -func (obj *cockroachImpl) UpdateNoReturn_Node_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_Node_By_Id(ctx context.Context, node_id Node_Id_Field, update Node_Update_Fields) ( err error) { @@ -19885,7 +19885,7 @@ func (obj *cockroachImpl) UpdateNoReturn_Node_By_Id(ctx context.Context, return nil } -func (obj *cockroachImpl) Update_AuditHistory_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Update_AuditHistory_By_NodeId(ctx context.Context, audit_history_node_id AuditHistory_NodeId_Field, update AuditHistory_Update_Fields) ( audit_history *AuditHistory, err error) { @@ -19926,7 +19926,7 @@ func (obj *cockroachImpl) Update_AuditHistory_By_NodeId(ctx context.Context, return audit_history, nil } -func (obj *cockroachImpl) Update_User_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Update_User_By_Id(ctx context.Context, user_id User_Id_Field, update User_Update_Fields) ( user *User, err error) { @@ -19992,7 +19992,7 @@ func (obj *cockroachImpl) Update_User_By_Id(ctx context.Context, return user, nil } -func (obj *cockroachImpl) Update_Project_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Update_Project_By_Id(ctx context.Context, project_id Project_Id_Field, update Project_Update_Fields) ( project *Project, err error) { @@ -20048,7 +20048,7 @@ func (obj *cockroachImpl) Update_Project_By_Id(ctx context.Context, return project, nil } -func (obj *cockroachImpl) UpdateNoReturn_ApiKey_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_ApiKey_By_Id(ctx context.Context, api_key_id ApiKey_Id_Field, update ApiKey_Update_Fields) ( err error) { @@ -20085,7 +20085,7 @@ func (obj *cockroachImpl) UpdateNoReturn_ApiKey_By_Id(ctx context.Context, return nil } -func (obj *cockroachImpl) UpdateNoReturn_PeerIdentity_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_PeerIdentity_By_NodeId(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field, update PeerIdentity_Update_Fields) ( err error) { @@ -20128,7 +20128,7 @@ func (obj *cockroachImpl) UpdateNoReturn_PeerIdentity_By_NodeId(ctx context.Cont return nil } -func (obj *cockroachImpl) Update_RegistrationToken_By_Secret(ctx context.Context, +func (obj *pgxcockroachImpl) Update_RegistrationToken_By_Secret(ctx context.Context, registration_token_secret RegistrationToken_Secret_Field, update RegistrationToken_Update_Fields) ( registration_token *RegistrationToken, err error) { @@ -20169,7 +20169,7 @@ func (obj *cockroachImpl) Update_RegistrationToken_By_Secret(ctx context.Context return registration_token, nil } -func (obj *cockroachImpl) UpdateNoReturn_Offer_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_Offer_By_Id(ctx context.Context, offer_id Offer_Id_Field, update Offer_Update_Fields) ( err error) { @@ -20251,7 +20251,7 @@ func (obj *cockroachImpl) UpdateNoReturn_Offer_By_Id(ctx context.Context, return nil } -func (obj *cockroachImpl) Update_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, +func (obj *pgxcockroachImpl) Update_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field, update BucketMetainfo_Update_Fields) ( @@ -20338,7 +20338,7 @@ func (obj *cockroachImpl) Update_BucketMetainfo_By_ProjectId_And_Name(ctx contex return bucket_metainfo, nil } -func (obj *cockroachImpl) UpdateNoReturn_GracefulExitProgress_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_GracefulExitProgress_By_NodeId(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field, update GracefulExitProgress_Update_Fields) ( err error) { @@ -20386,7 +20386,7 @@ func (obj *cockroachImpl) UpdateNoReturn_GracefulExitProgress_By_NodeId(ctx cont return nil } -func (obj *cockroachImpl) UpdateNoReturn_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field, @@ -20455,7 +20455,7 @@ func (obj *cockroachImpl) UpdateNoReturn_GracefulExitTransferQueue_By_NodeId_And return nil } -func (obj *cockroachImpl) Update_CoinpaymentsTransaction_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Update_CoinpaymentsTransaction_By_Id(ctx context.Context, coinpayments_transaction_id CoinpaymentsTransaction_Id_Field, update CoinpaymentsTransaction_Update_Fields) ( coinpayments_transaction *CoinpaymentsTransaction, err error) { @@ -20501,7 +20501,7 @@ func (obj *cockroachImpl) Update_CoinpaymentsTransaction_By_Id(ctx context.Conte return coinpayments_transaction, nil } -func (obj *cockroachImpl) Update_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, +func (obj *pgxcockroachImpl) Update_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, stripecoinpayments_apply_balance_intent_tx_id StripecoinpaymentsApplyBalanceIntent_TxId_Field, update StripecoinpaymentsApplyBalanceIntent_Update_Fields) ( stripecoinpayments_apply_balance_intent *StripecoinpaymentsApplyBalanceIntent, err error) { @@ -20542,7 +20542,7 @@ func (obj *cockroachImpl) Update_StripecoinpaymentsApplyBalanceIntent_By_TxId(ct return stripecoinpayments_apply_balance_intent, nil } -func (obj *cockroachImpl) Update_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Update_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, stripecoinpayments_invoice_project_record_id StripecoinpaymentsInvoiceProjectRecord_Id_Field, update StripecoinpaymentsInvoiceProjectRecord_Update_Fields) ( stripecoinpayments_invoice_project_record *StripecoinpaymentsInvoiceProjectRecord, err error) { @@ -20583,7 +20583,7 @@ func (obj *cockroachImpl) Update_StripecoinpaymentsInvoiceProjectRecord_By_Id(ct return stripecoinpayments_invoice_project_record, nil } -func (obj *cockroachImpl) Update_Coupon_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Update_Coupon_By_Id(ctx context.Context, coupon_id Coupon_Id_Field, update Coupon_Update_Fields) ( coupon *Coupon, err error) { @@ -20624,7 +20624,7 @@ func (obj *cockroachImpl) Update_Coupon_By_Id(ctx context.Context, return coupon, nil } -func (obj *cockroachImpl) Update_CouponUsage_By_CouponId_And_Period(ctx context.Context, +func (obj *pgxcockroachImpl) Update_CouponUsage_By_CouponId_And_Period(ctx context.Context, coupon_usage_coupon_id CouponUsage_CouponId_Field, coupon_usage_period CouponUsage_Period_Field, update CouponUsage_Update_Fields) ( @@ -20666,7 +20666,7 @@ func (obj *cockroachImpl) Update_CouponUsage_By_CouponId_And_Period(ctx context. return coupon_usage, nil } -func (obj *cockroachImpl) Update_CreditsSpending_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Update_CreditsSpending_By_Id(ctx context.Context, credits_spending_id CreditsSpending_Id_Field, update CreditsSpending_Update_Fields) ( credits_spending *CreditsSpending, err error) { @@ -20707,7 +20707,7 @@ func (obj *cockroachImpl) Update_CreditsSpending_By_Id(ctx context.Context, return credits_spending, nil } -func (obj *cockroachImpl) UpdateNoReturn_NodeApiVersion_By_Id_And_ApiVersion_Less(ctx context.Context, +func (obj *pgxcockroachImpl) UpdateNoReturn_NodeApiVersion_By_Id_And_ApiVersion_Less(ctx context.Context, node_api_version_id NodeApiVersion_Id_Field, node_api_version_api_version_less NodeApiVersion_ApiVersion_Field, update NodeApiVersion_Update_Fields) ( @@ -20746,7 +20746,7 @@ func (obj *cockroachImpl) UpdateNoReturn_NodeApiVersion_By_Id_And_ApiVersion_Les return nil } -func (obj *cockroachImpl) Delete_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_ValueAttribution_By_ProjectId_And_BucketName(ctx context.Context, value_attribution_project_id ValueAttribution_ProjectId_Field, value_attribution_bucket_name ValueAttribution_BucketName_Field) ( deleted bool, err error) { @@ -20774,7 +20774,7 @@ func (obj *cockroachImpl) Delete_ValueAttribution_By_ProjectId_And_BucketName(ct } -func (obj *cockroachImpl) Delete_PendingAudits_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_PendingAudits_By_NodeId(ctx context.Context, pending_audits_node_id PendingAudits_NodeId_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -20801,7 +20801,7 @@ func (obj *cockroachImpl) Delete_PendingAudits_By_NodeId(ctx context.Context, } -func (obj *cockroachImpl) Delete_Irreparabledb_By_Segmentpath(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_Irreparabledb_By_Segmentpath(ctx context.Context, irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -20828,7 +20828,7 @@ func (obj *cockroachImpl) Delete_Irreparabledb_By_Segmentpath(ctx context.Contex } -func (obj *cockroachImpl) Delete_AccountingRollup_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_AccountingRollup_By_Id(ctx context.Context, accounting_rollup_id AccountingRollup_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -20855,7 +20855,7 @@ func (obj *cockroachImpl) Delete_AccountingRollup_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Delete_Node_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_Node_By_Id(ctx context.Context, node_id Node_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -20882,7 +20882,7 @@ func (obj *cockroachImpl) Delete_Node_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Delete_User_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_User_By_Id(ctx context.Context, user_id User_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -20909,7 +20909,7 @@ func (obj *cockroachImpl) Delete_User_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Delete_Project_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_Project_By_Id(ctx context.Context, project_id Project_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -20936,7 +20936,7 @@ func (obj *cockroachImpl) Delete_Project_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Delete_ProjectMember_By_MemberId_And_ProjectId(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_ProjectMember_By_MemberId_And_ProjectId(ctx context.Context, project_member_member_id ProjectMember_MemberId_Field, project_member_project_id ProjectMember_ProjectId_Field) ( deleted bool, err error) { @@ -20964,7 +20964,7 @@ func (obj *cockroachImpl) Delete_ProjectMember_By_MemberId_And_ProjectId(ctx con } -func (obj *cockroachImpl) Delete_ApiKey_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_ApiKey_By_Id(ctx context.Context, api_key_id ApiKey_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -20991,7 +20991,7 @@ func (obj *cockroachImpl) Delete_ApiKey_By_Id(ctx context.Context, } -func (obj *cockroachImpl) Delete_SerialNumber_By_ExpiresAt_LessOrEqual(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_SerialNumber_By_ExpiresAt_LessOrEqual(ctx context.Context, serial_number_expires_at_less_or_equal SerialNumber_ExpiresAt_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -21018,7 +21018,7 @@ func (obj *cockroachImpl) Delete_SerialNumber_By_ExpiresAt_LessOrEqual(ctx conte } -func (obj *cockroachImpl) Delete_ConsumedSerial_By_ExpiresAt_LessOrEqual(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_ConsumedSerial_By_ExpiresAt_LessOrEqual(ctx context.Context, consumed_serial_expires_at_less_or_equal ConsumedSerial_ExpiresAt_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -21045,7 +21045,7 @@ func (obj *cockroachImpl) Delete_ConsumedSerial_By_ExpiresAt_LessOrEqual(ctx con } -func (obj *cockroachImpl) Delete_ResetPasswordToken_By_Secret(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_ResetPasswordToken_By_Secret(ctx context.Context, reset_password_token_secret ResetPasswordToken_Secret_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -21072,7 +21072,7 @@ func (obj *cockroachImpl) Delete_ResetPasswordToken_By_Secret(ctx context.Contex } -func (obj *cockroachImpl) Delete_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_BucketMetainfo_By_ProjectId_And_Name(ctx context.Context, bucket_metainfo_project_id BucketMetainfo_ProjectId_Field, bucket_metainfo_name BucketMetainfo_Name_Field) ( deleted bool, err error) { @@ -21100,7 +21100,7 @@ func (obj *cockroachImpl) Delete_BucketMetainfo_By_ProjectId_And_Name(ctx contex } -func (obj *cockroachImpl) Delete_GracefulExitProgress_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_GracefulExitProgress_By_NodeId(ctx context.Context, graceful_exit_progress_node_id GracefulExitProgress_NodeId_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -21127,7 +21127,7 @@ func (obj *cockroachImpl) Delete_GracefulExitProgress_By_NodeId(ctx context.Cont } -func (obj *cockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -21154,7 +21154,7 @@ func (obj *cockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId(ctx context } -func (obj *cockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Path_And_PieceNum(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field, graceful_exit_transfer_queue_path GracefulExitTransferQueue_Path_Field, graceful_exit_transfer_queue_piece_num GracefulExitTransferQueue_PieceNum_Field) ( @@ -21183,7 +21183,7 @@ func (obj *cockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Path_An } -func (obj *cockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_FinishedAt_IsNot_Null(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_FinishedAt_IsNot_Null(ctx context.Context, graceful_exit_transfer_queue_node_id GracefulExitTransferQueue_NodeId_Field) ( count int64, err error) { defer mon.Task()(&ctx)(&err) @@ -21210,7 +21210,7 @@ func (obj *cockroachImpl) Delete_GracefulExitTransferQueue_By_NodeId_And_Finishe } -func (obj *cockroachImpl) Delete_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_StripecoinpaymentsApplyBalanceIntent_By_TxId(ctx context.Context, stripecoinpayments_apply_balance_intent_tx_id StripecoinpaymentsApplyBalanceIntent_TxId_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -21237,7 +21237,7 @@ func (obj *cockroachImpl) Delete_StripecoinpaymentsApplyBalanceIntent_By_TxId(ct } -func (obj *cockroachImpl) Delete_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_StripecoinpaymentsInvoiceProjectRecord_By_Id(ctx context.Context, stripecoinpayments_invoice_project_record_id StripecoinpaymentsInvoiceProjectRecord_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -21264,7 +21264,7 @@ func (obj *cockroachImpl) Delete_StripecoinpaymentsInvoiceProjectRecord_By_Id(ct } -func (obj *cockroachImpl) Delete_Coupon_By_Id(ctx context.Context, +func (obj *pgxcockroachImpl) Delete_Coupon_By_Id(ctx context.Context, coupon_id Coupon_Id_Field) ( deleted bool, err error) { defer mon.Task()(&ctx)(&err) @@ -21291,17 +21291,17 @@ func (obj *cockroachImpl) Delete_Coupon_By_Id(ctx context.Context, } -func (impl cockroachImpl) isConstraintError(err error) ( +func (impl pgxcockroachImpl) isConstraintError(err error) ( constraint string, ok bool) { - if e, ok := err.(*pq.Error); ok { - if e.Code.Class() == "23" { - return e.Constraint, true + if e, ok := err.(*pgconn.PgError); ok { + if e.Code[:2] == "23" { + return e.ConstraintName, true } } return "", false } -func (obj *cockroachImpl) deleteAll(ctx context.Context) (count int64, err error) { +func (obj *pgxcockroachImpl) deleteAll(ctx context.Context) (count int64, err error) { defer mon.Task()(&ctx)(&err) var __res sql.Result var __count int64 @@ -22184,18 +22184,6 @@ func (rx *Rx) CreateNoReturn_Node(ctx context.Context, } -func (rx *Rx) CreateNoReturn_NodeApiVersion(ctx context.Context, - node_api_version_id NodeApiVersion_Id_Field, - node_api_version_api_version NodeApiVersion_ApiVersion_Field) ( - err error) { - var tx *Tx - if tx, err = rx.getTx(ctx); err != nil { - return - } - return tx.CreateNoReturn_NodeApiVersion(ctx, node_api_version_id, node_api_version_api_version) - -} - func (rx *Rx) CreateNoReturn_PeerIdentity(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field, peer_identity_leaf_serial_number PeerIdentity_LeafSerialNumber_Field, @@ -23408,6 +23396,18 @@ func (rx *Rx) Paged_PendingSerialQueue(ctx context.Context, return tx.Paged_PendingSerialQueue(ctx, limit, start) } +func (rx *Rx) ReplaceNoReturn_NodeApiVersion(ctx context.Context, + node_api_version_id NodeApiVersion_Id_Field, + node_api_version_api_version NodeApiVersion_ApiVersion_Field) ( + err error) { + var tx *Tx + if tx, err = rx.getTx(ctx); err != nil { + return + } + return tx.ReplaceNoReturn_NodeApiVersion(ctx, node_api_version_id, node_api_version_api_version) + +} + func (rx *Rx) ReplaceNoReturn_PendingSerialQueue(ctx context.Context, pending_serial_queue_storage_node_id PendingSerialQueue_StorageNodeId_Field, pending_serial_queue_bucket_id PendingSerialQueue_BucketId_Field, @@ -23842,11 +23842,6 @@ type Methods interface { optional Node_Create_Fields) ( err error) - CreateNoReturn_NodeApiVersion(ctx context.Context, - node_api_version_id NodeApiVersion_Id_Field, - node_api_version_api_version NodeApiVersion_ApiVersion_Field) ( - err error) - CreateNoReturn_PeerIdentity(ctx context.Context, peer_identity_node_id PeerIdentity_NodeId_Field, peer_identity_leaf_serial_number PeerIdentity_LeafSerialNumber_Field, @@ -24414,6 +24409,11 @@ type Methods interface { limit int, start *Paged_PendingSerialQueue_Continuation) ( rows []*PendingSerialQueue, next *Paged_PendingSerialQueue_Continuation, err error) + ReplaceNoReturn_NodeApiVersion(ctx context.Context, + node_api_version_id NodeApiVersion_Id_Field, + node_api_version_api_version NodeApiVersion_ApiVersion_Field) ( + err error) + ReplaceNoReturn_PendingSerialQueue(ctx context.Context, pending_serial_queue_storage_node_id PendingSerialQueue_StorageNodeId_Field, pending_serial_queue_bucket_id PendingSerialQueue_BucketId_Field, @@ -24568,17 +24568,17 @@ type dbMethods interface { makeErr(err error) error } -func openpostgres(source string) (*sql.DB, error) { - return sql.Open("postgres", source) +func openpgx(source string) (*sql.DB, error) { + return sql.Open("pgx", source) } -func opencockroach(source string) (*sql.DB, error) { +func openpgxcockroach(source string) (*sql.DB, error) { // try first with "cockroach" as a driver in case someone has registered - // some special stuff. if that fails, then try again with "postgres" as + // some special stuff. if that fails, then try again with "pgx" as // the driver. db, err := sql.Open("cockroach", source) if err != nil { - db, err = sql.Open("postgres", source) + db, err = sql.Open("pgx", source) } return db, err } diff --git a/satellite/satellitedb/dbx/satellitedb.dbx.cockroach.sql b/satellite/satellitedb/dbx/satellitedb.dbx.pgx.sql similarity index 100% rename from satellite/satellitedb/dbx/satellitedb.dbx.cockroach.sql rename to satellite/satellitedb/dbx/satellitedb.dbx.pgx.sql diff --git a/satellite/satellitedb/dbx/satellitedb.dbx.postgres.sql b/satellite/satellitedb/dbx/satellitedb.dbx.pgxcockroach.sql similarity index 100% rename from satellite/satellitedb/dbx/satellitedb.dbx.postgres.sql rename to satellite/satellitedb/dbx/satellitedb.dbx.pgxcockroach.sql diff --git a/satellite/satellitedb/gracefulexit.go b/satellite/satellitedb/gracefulexit.go index 86b93afb7..6d9ea2708 100644 --- a/satellite/satellitedb/gracefulexit.go +++ b/satellite/satellitedb/gracefulexit.go @@ -10,10 +10,10 @@ import ( "sort" "time" - "github.com/lib/pq" "github.com/zeebo/errs" "storj.io/common/storj" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/private/tagsql" "storj.io/storj/satellite/gracefulexit" "storj.io/storj/satellite/satellitedb/dbx" @@ -98,7 +98,7 @@ func (db *gracefulexitDB) Enqueue(ctx context.Context, items []gracefulexit.Tran _, err = db.db.ExecContext(ctx, db.db.Rebind(` INSERT INTO graceful_exit_transfer_queue(node_id, path, piece_num, root_piece_id, durability_ratio, queued_at) SELECT unnest($1::bytea[]), unnest($2::bytea[]), unnest($3::integer[]), unnest($4::bytea[]), unnest($5::float8[]), $6 - ON CONFLICT DO NOTHING;`), postgresNodeIDList(nodeIDs), pq.ByteaArray(paths), pq.Array(pieceNums), pq.ByteaArray(rootPieceIDs), pq.Array(durabilities), time.Now().UTC()) + ON CONFLICT DO NOTHING;`), pgutil.NodeIDArray(nodeIDs), pgutil.ByteaArray(paths), pgutil.Int4Array(pieceNums), pgutil.ByteaArray(rootPieceIDs), pgutil.Float8Array(durabilities), time.Now().UTC()) return Error.Wrap(err) } diff --git a/satellite/satellitedb/migrate.go b/satellite/satellitedb/migrate.go index ffef8bee0..4b00601c8 100644 --- a/satellite/satellitedb/migrate.go +++ b/satellite/satellitedb/migrate.go @@ -8,7 +8,6 @@ import ( "fmt" "strings" - "github.com/lib/pq" "github.com/zeebo/errs" "go.uber.org/zap" @@ -54,7 +53,7 @@ func (db *satelliteDB) MigrateToLatest(ctx context.Context) error { } _, err := db.Exec(ctx, fmt.Sprintf(`CREATE DATABASE IF NOT EXISTS %s;`, - pq.QuoteIdentifier(dbName))) + pgutil.QuoteIdentifier(dbName))) if err != nil { return errs.Wrap(err) } @@ -104,7 +103,7 @@ func (db *satelliteDB) TestingMigrateToLatest(ctx context.Context) error { return ErrMigrateMinVersion.New("error querying current database: %+v", err) } - _, err := db.Exec(ctx, fmt.Sprintf(`CREATE DATABASE IF NOT EXISTS %s;`, pq.QuoteIdentifier(dbName))) + _, err := db.Exec(ctx, fmt.Sprintf(`CREATE DATABASE IF NOT EXISTS %s;`, pgutil.QuoteIdentifier(dbName))) if err != nil { return ErrMigrateMinVersion.Wrap(err) } diff --git a/satellite/satellitedb/migrate_test.go b/satellite/satellitedb/migrate_test.go index 5fb5164b3..7b8f5c47c 100644 --- a/satellite/satellitedb/migrate_test.go +++ b/satellite/satellitedb/migrate_test.go @@ -5,6 +5,7 @@ package satellitedb_test import ( "context" + "errors" "fmt" "io/ioutil" "path/filepath" @@ -12,7 +13,7 @@ import ( "testing" "time" - "github.com/lib/pq" + "github.com/jackc/pgconn" "github.com/stretchr/testify/require" "github.com/zeebo/errs" "go.uber.org/zap" @@ -57,8 +58,9 @@ func loadSnapshots(ctx context.Context, connstr, dbxscript string) (*dbschema.Sn snapshot, err := loadSnapshotFromSQL(ctx, connstr, string(scriptData)) if err != nil { - if pqErr, ok := err.(*pq.Error); ok && pqErr.Detail != "" { - return fmt.Errorf("Version %d error: %v\nDetail: %s\nHint: %s", version, pqErr, pqErr.Detail, pqErr.Hint) + var pgErr *pgconn.PgError + if errors.As(err, &pgErr) { + return fmt.Errorf("Version %d error: %v\nDetail: %s\nHint: %s", version, pgErr, pgErr.Detail, pgErr.Hint) } return fmt.Errorf("Version %d error: %+v", version, err) } diff --git a/satellite/satellitedb/nodeapiversion.go b/satellite/satellitedb/nodeapiversion.go index 9b2034599..890bb942a 100644 --- a/satellite/satellitedb/nodeapiversion.go +++ b/satellite/satellitedb/nodeapiversion.go @@ -22,7 +22,7 @@ type nodeAPIVersionDB struct { func (db *nodeAPIVersionDB) UpdateVersionAtLeast(ctx context.Context, id storj.NodeID, version nodeapiversion.Version) (err error) { defer mon.Task()(&ctx)(&err) // try to create a row at the version - err = db.db.CreateNoReturn_NodeApiVersion(ctx, + err = db.db.ReplaceNoReturn_NodeApiVersion(ctx, dbx.NodeApiVersion_Id(id.Bytes()), dbx.NodeApiVersion_ApiVersion(int(version))) if errs.IsFunc(err, dbx.IsConstraintError) { diff --git a/satellite/satellitedb/nodeselection.go b/satellite/satellitedb/nodeselection.go index d1b4f0dde..6d7cf4da5 100644 --- a/satellite/satellitedb/nodeselection.go +++ b/satellite/satellitedb/nodeselection.go @@ -10,12 +10,12 @@ import ( "strings" "time" - "github.com/lib/pq" "github.com/zeebo/errs" "storj.io/common/pb" "storj.io/common/storj" "storj.io/private/version" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/satellite/overlay" ) @@ -207,14 +207,14 @@ func nodeSelectionCondition(ctx context.Context, criteria *overlay.NodeCriteria, if len(excludedIDs) > 0 { conds.add( `not (id = any(?::bytea[]))`, - postgresNodeIDList(excludedIDs), + pgutil.NodeIDArray(excludedIDs), ) } if criteria.DistinctIP { if len(excludedNetworks) > 0 { conds.add( `not (last_net = any(?::text[]))`, - pq.Array(excludedNetworks), + pgutil.StringArray(excludedNetworks), ) } conds.add(`last_net <> ''`) diff --git a/satellite/satellitedb/orders.go b/satellite/satellitedb/orders.go index f415eea6e..035a55701 100644 --- a/satellite/satellitedb/orders.go +++ b/satellite/satellitedb/orders.go @@ -8,7 +8,6 @@ import ( "database/sql" "time" - "github.com/lib/pq" "github.com/zeebo/errs" "go.uber.org/zap" @@ -270,7 +269,7 @@ func (db *ordersDB) ProcessOrders(ctx context.Context, requests []*orders.Proces serial_numbers sn, unnest($1::bytea[]) WITH ORDINALITY AS request(serial_number, i) WHERE request.serial_number = sn.serial_number - `, pq.ByteaArray(serialNums)) + `, pgutil.ByteaArray(serialNums)) if err != nil { return nil, Error.Wrap(err) } @@ -378,13 +377,18 @@ func (db *ordersDB) ProcessOrders(ctx context.Context, requests []*orders.Proces return nil, Error.New("invalid dbType: %v", db.db.driver) } + actionNumArray := make([]int32, len(actionArray)) + for i, num := range actionArray { + actionNumArray[i] = int32(num) + } + _, err = db.db.ExecContext(ctx, stmt, storageNodeID.Bytes(), - pq.ByteaArray(bucketIDArray), - pq.ByteaArray(serialNumArray), - pq.Array(actionArray), - pq.Array(settledArray), - pq.Array(expiresAtArray), + pgutil.ByteaArray(bucketIDArray), + pgutil.ByteaArray(serialNumArray), + pgutil.Int4Array(actionNumArray), + pgutil.Int8Array(settledArray), + pgutil.TimestampTZArray(expiresAtArray), ) if err != nil { return nil, Error.Wrap(err) @@ -458,9 +462,9 @@ func (tx *ordersDBTx) UpdateBucketBandwidthBatch(ctx context.Context, intervalSt allocated = bucket_bandwidth_rollups.allocated + EXCLUDED.allocated, inline = bucket_bandwidth_rollups.inline + EXCLUDED.inline, settled = bucket_bandwidth_rollups.settled + EXCLUDED.settled`, - pq.ByteaArray(bucketNames), pq.ByteaArray(projectIDs), + pgutil.ByteaArray(bucketNames), pgutil.ByteaArray(projectIDs), intervalStart, defaultIntervalSeconds, - pq.Array(actionSlice), pq.Array(inlineSlice), pq.Array(allocatedSlice), pq.Array(settledSlice)) + pgutil.Int4Array(actionSlice), pgutil.Int8Array(inlineSlice), pgutil.Int8Array(allocatedSlice), pgutil.Int8Array(settledSlice)) if err != nil { tx.log.Error("Bucket bandwidth rollup batch flush failed.", zap.Error(err)) } @@ -486,7 +490,7 @@ func (tx *ordersDBTx) UpdateBucketBandwidthBatch(ctx context.Context, intervalSt ON CONFLICT(project_id, interval_month) DO UPDATE SET egress_allocated = project_bandwidth_rollups.egress_allocated + EXCLUDED.egress_allocated::bigint; `, - pq.ByteaArray(projectRUIDs), projectInterval, pq.Array(projectRUAllocated)) + pgutil.ByteaArray(projectRUIDs), projectInterval, pgutil.Int8Array(projectRUAllocated)) if err != nil { tx.log.Error("Project bandwidth rollup batch flush failed.", zap.Error(err)) } @@ -532,9 +536,9 @@ func (tx *ordersDBTx) UpdateStoragenodeBandwidthBatch(ctx context.Context, inter DO UPDATE SET allocated = storagenode_bandwidth_rollups.allocated + EXCLUDED.allocated, settled = storagenode_bandwidth_rollups.settled + EXCLUDED.settled`, - postgresNodeIDList(storageNodeIDs), + pgutil.NodeIDArray(storageNodeIDs), intervalStart, defaultIntervalSeconds, - pq.Array(actionSlice), pq.Array(allocatedSlice), pq.Array(settledSlice)) + pgutil.Int4Array(actionSlice), pgutil.Int8Array(allocatedSlice), pgutil.Int8Array(settledSlice)) if err != nil { tx.log.Error("Storagenode bandwidth rollup batch flush failed.", zap.Error(err)) } @@ -583,9 +587,9 @@ func (tx *ordersDBTx) CreateConsumedSerialsBatch(ctx context.Context, consumedSe } _, err = tx.tx.Tx.ExecContext(ctx, stmt, - pq.ByteaArray(storageNodeIDSlice), - pq.ByteaArray(serialNumberSlice), - pq.Array(expiresAtSlice), + pgutil.ByteaArray(storageNodeIDSlice), + pgutil.ByteaArray(serialNumberSlice), + pgutil.TimestampTZArray(expiresAtSlice), ) return Error.Wrap(err) } diff --git a/satellite/satellitedb/overlaycache.go b/satellite/satellitedb/overlaycache.go index 9e451c0d4..479d32a98 100644 --- a/satellite/satellitedb/overlaycache.go +++ b/satellite/satellitedb/overlaycache.go @@ -11,7 +11,6 @@ import ( "sort" "time" - "github.com/lib/pq" "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" @@ -19,6 +18,7 @@ import ( "storj.io/common/pb" "storj.io/common/storj" "storj.io/private/version" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/private/tagsql" "storj.io/storj/satellite/overlay" "storj.io/storj/satellite/satellitedb/dbx" @@ -109,7 +109,7 @@ func (cache *overlaycache) GetNodesNetwork(ctx context.Context, nodeIDs []storj. rows, err = cache.db.Query(ctx, cache.db.Rebind(` SELECT last_net FROM nodes WHERE id = any($1::bytea[]) - `), postgresNodeIDList(nodeIDs), + `), pgutil.NodeIDArray(nodeIDs), ) if err != nil { return nil, err @@ -158,7 +158,7 @@ func (cache *overlaycache) GetOnlineNodesForGetDelete(ctx context.Context, nodeI AND disqualified IS NULL AND exit_finished_at IS NULL AND last_contact_success > $2 - `), postgresNodeIDList(nodeIDs), time.Now().Add(-onlineWindow)) + `), pgutil.NodeIDArray(nodeIDs), time.Now().Add(-onlineWindow)) if err != nil { return nil, err } @@ -198,7 +198,7 @@ func (cache *overlaycache) KnownOffline(ctx context.Context, criteria *overlay.N SELECT id FROM nodes WHERE id = any($1::bytea[]) AND last_contact_success < $2 - `), postgresNodeIDList(nodeIds), time.Now().Add(-criteria.OnlineWindow), + `), pgutil.NodeIDArray(nodeIds), time.Now().Add(-criteria.OnlineWindow), ) if err != nil { return nil, err @@ -233,7 +233,7 @@ func (cache *overlaycache) KnownUnreliableOrOffline(ctx context.Context, criteri AND unknown_audit_suspended IS NULL AND exit_finished_at IS NULL AND last_contact_success > $2 - `), postgresNodeIDList(nodeIds), time.Now().Add(-criteria.OnlineWindow), + `), pgutil.NodeIDArray(nodeIds), time.Now().Add(-criteria.OnlineWindow), ) if err != nil { return nil, err @@ -274,7 +274,7 @@ func (cache *overlaycache) KnownReliable(ctx context.Context, onlineWindow time. AND unknown_audit_suspended IS NULL AND exit_finished_at IS NULL AND last_contact_success > $2 - `), postgresNodeIDList(nodeIDs), time.Now().Add(-onlineWindow), + `), pgutil.NodeIDArray(nodeIDs), time.Now().Add(-onlineWindow), ) if err != nil { return nil, err @@ -682,7 +682,7 @@ func (cache *overlaycache) UpdatePieceCounts(ctx context.Context, pieceCounts ma SELECT unnest($1::bytea[]) as id, unnest($2::bigint[]) as count ) as update WHERE nodes.id = update.id - `, postgresNodeIDList(nodeIDs), pq.Array(countNumbers)) + `, pgutil.NodeIDArray(nodeIDs), pgutil.Int8Array(countNumbers)) return Error.Wrap(err) } diff --git a/satellite/satellitedb/projectaccounting.go b/satellite/satellitedb/projectaccounting.go index 2cc563b7e..fe188c400 100644 --- a/satellite/satellitedb/projectaccounting.go +++ b/satellite/satellitedb/projectaccounting.go @@ -9,13 +9,13 @@ import ( "fmt" "time" - "github.com/lib/pq" "github.com/zeebo/errs" "storj.io/common/memory" "storj.io/common/pb" "storj.io/common/uuid" "storj.io/storj/private/dbutil" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/satellite/accounting" "storj.io/storj/satellite/satellitedb/dbx" ) @@ -35,17 +35,17 @@ func (db *ProjectAccounting) SaveTallies(ctx context.Context, intervalStart time return nil } var bucketNames, projectIDs [][]byte - var inlineBytes, remoteBytes, metadataSizes []uint64 - var remoteSegments, inlineSegments, objectCounts []uint + var inlineBytes, remoteBytes, metadataSizes []int64 + var remoteSegments, inlineSegments, objectCounts []int64 for _, info := range bucketTallies { bucketNames = append(bucketNames, info.BucketName) projectIDs = append(projectIDs, info.ProjectID[:]) - inlineBytes = append(inlineBytes, uint64(info.InlineBytes)) - remoteBytes = append(remoteBytes, uint64(info.RemoteBytes)) - remoteSegments = append(remoteSegments, uint(info.RemoteSegments)) - inlineSegments = append(inlineSegments, uint(info.InlineSegments)) - objectCounts = append(objectCounts, uint(info.ObjectCount)) - metadataSizes = append(metadataSizes, uint64(info.MetadataSize)) + inlineBytes = append(inlineBytes, info.InlineBytes) + remoteBytes = append(remoteBytes, info.RemoteBytes) + remoteSegments = append(remoteSegments, info.RemoteSegments) + inlineSegments = append(inlineSegments, info.InlineSegments) + objectCounts = append(objectCounts, info.ObjectCount) + metadataSizes = append(metadataSizes, info.MetadataSize) } _, err = db.db.DB.ExecContext(ctx, db.db.Rebind(` INSERT INTO bucket_storage_tallies ( @@ -61,10 +61,10 @@ func (db *ProjectAccounting) SaveTallies(ctx context.Context, intervalStart time unnest($6::int[]), unnest($7::int[]), unnest($8::int[]), unnest($9::int8[])`), intervalStart, - pq.ByteaArray(bucketNames), pq.ByteaArray(projectIDs), - pq.Array(inlineBytes), pq.Array(remoteBytes), - pq.Array(remoteSegments), pq.Array(inlineSegments), - pq.Array(objectCounts), pq.Array(metadataSizes)) + pgutil.ByteaArray(bucketNames), pgutil.ByteaArray(projectIDs), + pgutil.Int8Array(inlineBytes), pgutil.Int8Array(remoteBytes), + pgutil.Int8Array(remoteSegments), pgutil.Int8Array(inlineSegments), + pgutil.Int8Array(objectCounts), pgutil.Int8Array(metadataSizes)) return Error.Wrap(err) } diff --git a/satellite/satellitedb/storagenodeaccounting.go b/satellite/satellitedb/storagenodeaccounting.go index 2e7ffe43f..bb1ae4925 100644 --- a/satellite/satellitedb/storagenodeaccounting.go +++ b/satellite/satellitedb/storagenodeaccounting.go @@ -8,11 +8,11 @@ import ( "database/sql" "time" - "github.com/lib/pq" "github.com/zeebo/errs" "storj.io/common/storj" "storj.io/storj/private/dbutil" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/satellite/accounting" "storj.io/storj/satellite/compensation" "storj.io/storj/satellite/satellitedb/dbx" @@ -45,7 +45,7 @@ func (db *StoragenodeAccounting) SaveTallies(ctx context.Context, latestTally ti $1, unnest($2::bytea[]), unnest($3::float8[])`), latestTally, - postgresNodeIDList(nodeIDs), pq.Array(totals)) + pgutil.NodeIDArray(nodeIDs), pgutil.Float8Array(totals)) if err != nil { return err } diff --git a/satellite/satellitedb/utils.go b/satellite/satellitedb/utils.go deleted file mode 100644 index 0830e68ea..000000000 --- a/satellite/satellitedb/utils.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2019 Storj Labs, Inc. -// See LICENSE for copying information. - -package satellitedb - -import ( - "database/sql/driver" - - "storj.io/common/storj" -) - -type postgresNodeIDList storj.NodeIDList - -// Value converts a NodeIDList to a postgres array -func (nodes postgresNodeIDList) Value() (driver.Value, error) { - const hextable = "0123456789abcdef" - - if nodes == nil { - return nil, nil - } - if len(nodes) == 0 { - return []byte("{}"), nil - } - - var wp, x int - out := make([]byte, 2+len(nodes)*(6+storj.NodeIDSize*2)-1) - - x = copy(out[wp:], []byte(`{"\\x`)) - wp += x - - for i := range nodes { - for _, v := range nodes[i] { - out[wp] = hextable[v>>4] - out[wp+1] = hextable[v&0xf] - wp += 2 - } - - if i+1 < len(nodes) { - x = copy(out[wp:], []byte(`","\\x`)) - wp += x - } - } - - x = copy(out[wp:], `"}`) - wp += x - - if wp != len(out) { - panic("unreachable") - } - - return out, nil -} diff --git a/storage/cockroachkv/client.go b/storage/cockroachkv/client.go index 826606820..6f8ed070a 100644 --- a/storage/cockroachkv/client.go +++ b/storage/cockroachkv/client.go @@ -9,7 +9,6 @@ import ( "database/sql" "sort" - "github.com/lib/pq" "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" @@ -137,7 +136,7 @@ func (client *Client) getAllOnce(ctx context.Context, keys storage.Keys) (values ON (pd.fullpath = pk.request) ORDER BY pk.ord ` - rows, err := client.db.QueryContext(ctx, q, pq.ByteaArray(keys.ByteSlices())) + rows, err := client.db.QueryContext(ctx, q, pgutil.ByteaArray(keys.ByteSlices())) if err != nil { return nil, err } @@ -212,7 +211,7 @@ func (client *Client) deleteMultipleOnce(ctx context.Context, keys storage.Keys) DELETE FROM pathdata WHERE fullpath = any($1::BYTEA[]) RETURNING fullpath, metadata`, - pq.ByteaArray(keys.ByteSlices())) + pgutil.ByteaArray(keys.ByteSlices())) if err != nil { return nil, err } diff --git a/storage/cockroachkv/client_test.go b/storage/cockroachkv/client_test.go index e666ccd86..37a7be8b5 100644 --- a/storage/cockroachkv/client_test.go +++ b/storage/cockroachkv/client_test.go @@ -6,7 +6,6 @@ import ( "context" "testing" - _ "github.com/lib/pq" "github.com/stretchr/testify/require" "storj.io/common/testcontext" diff --git a/storage/cockroachkv/ordered_iterator.go b/storage/cockroachkv/ordered_iterator.go index fbb0a5561..4c899684a 100644 --- a/storage/cockroachkv/ordered_iterator.go +++ b/storage/cockroachkv/ordered_iterator.go @@ -164,6 +164,13 @@ func (oci *orderedCockroachIterator) doNextQuery(ctx context.Context) (_ tagsql. gt := ">" start := oci.lastKeySeen + largestKey := []byte(oci.largestKey) + if largestKey == nil { + // github.com/lib/pq would treat nil as an empty bytea array, while + // github.com/jackc/pgx will treat nil as NULL. Make an explicit empty + // byte array so that they'll work the same. + largestKey = []byte{} + } if len(start) == 0 { start = oci.opts.First gt = ">=" @@ -178,5 +185,5 @@ func (oci *orderedCockroachIterator) doNextQuery(ctx context.Context) (_ tagsql. WHERE pd.fullpath %s $1:::BYTEA AND ($2:::BYTEA = '':::BYTEA OR pd.fullpath < $2:::BYTEA) LIMIT $3 - `, gt), start, []byte(oci.largestKey), oci.batchSize) + `, gt), start, largestKey, oci.batchSize) } diff --git a/storage/cockroachkv/schema/migrate.go b/storage/cockroachkv/schema/migrate.go index e32757f84..e9879e5d6 100644 --- a/storage/cockroachkv/schema/migrate.go +++ b/storage/cockroachkv/schema/migrate.go @@ -7,9 +7,9 @@ import ( "context" "fmt" - "github.com/lib/pq" "github.com/zeebo/errs" + "storj.io/storj/private/dbutil/pgutil" "storj.io/storj/private/tagsql" ) @@ -34,6 +34,6 @@ func PrepareDB(ctx context.Context, db tagsql.DB) (err error) { metadata BYTEA NOT NULL, bucket BYTEA ); - `, pq.QuoteIdentifier(dbName))) + `, pgutil.QuoteIdentifier(dbName))) return errs.Wrap(err) } diff --git a/storage/postgreskv/client.go b/storage/postgreskv/client.go index efab743f0..d9f275ca3 100644 --- a/storage/postgreskv/client.go +++ b/storage/postgreskv/client.go @@ -8,7 +8,6 @@ import ( "database/sql" "sort" - "github.com/lib/pq" "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" @@ -34,7 +33,7 @@ type Client struct { func New(dbURL string) (*Client, error) { dbURL = pgutil.CheckApplicationName(dbURL) - db, err := tagsql.Open("postgres", dbURL) + db, err := tagsql.Open("pgx", dbURL) if err != nil { return nil, err } @@ -119,7 +118,7 @@ func (client *Client) GetAll(ctx context.Context, keys storage.Keys) (_ storage. ON (pd.fullpath = pk.request) ORDER BY pk.ord ` - rows, err := client.db.Query(ctx, q, pq.ByteaArray(keys.ByteSlices())) + rows, err := client.db.Query(ctx, q, pgutil.ByteaArray(keys.ByteSlices())) if err != nil { return nil, errs.Wrap(err) } @@ -174,7 +173,7 @@ func (client *Client) DeleteMultiple(ctx context.Context, keys []storage.Key) (_ DELETE FROM pathdata WHERE fullpath = any($1::BYTEA[]) RETURNING fullpath, metadata`, - pq.ByteaArray(storage.Keys(keys).ByteSlices())) + pgutil.ByteaArray(storage.Keys(keys).ByteSlices())) if err != nil { return nil, err } diff --git a/storage/postgreskv/client_test.go b/storage/postgreskv/client_test.go index 4e2667740..10ad36357 100644 --- a/storage/postgreskv/client_test.go +++ b/storage/postgreskv/client_test.go @@ -8,13 +8,13 @@ import ( "strings" "testing" - "github.com/lib/pq" + "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/stdlib" "github.com/stretchr/testify/require" "github.com/zeebo/errs" "storj.io/common/testcontext" "storj.io/storj/private/dbutil/pgtest" - "storj.io/storj/private/dbutil/txutil" "storj.io/storj/private/tagsql" "storj.io/storj/storage" "storj.io/storj/storage/testsuite" @@ -102,30 +102,38 @@ func BenchmarkSuite(b *testing.B) { testsuite.RunBenchmarks(b, store) } -func bulkImport(ctx context.Context, db tagsql.DB, iter storage.Iterator) error { - return txutil.WithTx(ctx, db, nil, func(ctx context.Context, txn tagsql.Tx) (err error) { - stmt, err := txn.Prepare(ctx, pq.CopyIn("pathdata", "fullpath", "metadata")) - if err != nil { - return errs.New("Failed to initialize COPY FROM: %v", err) - } - defer func() { - err2 := stmt.Close() - if err2 != nil { - err = errs.Combine(err, errs.New("Failed to close COPY FROM statement: %v", err2)) - } - }() +type bulkImportCopyFromSource struct { + ctx context.Context + iter storage.Iterator + item storage.ListItem +} - var item storage.ListItem - for iter.Next(ctx, &item) { - if _, err := stmt.Exec(ctx, []byte(item.Key), []byte(item.Value)); err != nil { - return err - } - } - if _, err = stmt.Exec(ctx); err != nil { - return errs.New("Failed to complete COPY FROM: %v", err) - } - return nil - }) +func (bs *bulkImportCopyFromSource) Next() bool { + return bs.iter.Next(bs.ctx, &bs.item) +} + +func (bs *bulkImportCopyFromSource) Values() ([]interface{}, error) { + return []interface{}{bs.item.Key, bs.item.Value}, nil +} + +func (bs *bulkImportCopyFromSource) Err() error { + // we can't determine this from storage.Iterator, I guess + return nil +} + +func bulkImport(ctx context.Context, db tagsql.DB, iter storage.Iterator) (err error) { + defer mon.Task()(&ctx)(&err) + pgxConn, err := stdlib.AcquireConn(db.Internal()) + if err != nil { + return err + } + defer func() { + err = errs.Combine(err, stdlib.ReleaseConn(db.Internal(), pgxConn)) + }() + + importSource := &bulkImportCopyFromSource{iter: iter} + _, err = pgxConn.CopyFrom(ctx, pgx.Identifier{"pathdata"}, []string{"fullpath", "metadata"}, importSource) + return err } func bulkDeleteAll(ctx context.Context, db tagsql.DB) error { diff --git a/storage/postgreskv/ordered_iterator.go b/storage/postgreskv/ordered_iterator.go index 5eccf0ba4..8429a8e21 100644 --- a/storage/postgreskv/ordered_iterator.go +++ b/storage/postgreskv/ordered_iterator.go @@ -156,6 +156,13 @@ func (opi *orderedPostgresIterator) doNextQuery(ctx context.Context) (_ tagsql.R start = storage.AfterPrefix(start) gt = ">=" } + var endLimitKey = opi.largestKey + if endLimitKey == nil { + // jackc/pgx will treat nil as a NULL value, while lib/pq treats it as + // an empty string. We'll remove the ambiguity by making it a zero-length + // byte slice instead + endLimitKey = []byte{} + } return opi.client.db.Query(ctx, fmt.Sprintf(` SELECT pd.fullpath, pd.metadata @@ -164,5 +171,5 @@ func (opi *orderedPostgresIterator) doNextQuery(ctx context.Context) (_ tagsql.R AND ($2::BYTEA = ''::BYTEA OR pd.fullpath < $2::BYTEA) ORDER BY pd.fullpath LIMIT $3 - `, gt), start, []byte(opi.largestKey), opi.batchSize) + `, gt), start, endLimitKey, opi.batchSize) }