diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33b325d940f3..91f95494c5f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,8 +117,6 @@ The `internal` subpackages contain most of the FerretDB code: * `types` package provides Go types matching BSON types that don't have built-in Go equivalents: we use `int32` for BSON's int32, but `types.ObjectID` for BSON's ObjectId. * `types/fjson` provides converters from/to FJSON for built-in and `types` types. - FJSON adds some extensions to JSON for keeping object keys in order, - preserving BSON type information in the values themselves, etc. It is used for logging of BSON values and wire protocol messages. * `bson` package provides converters from/to BSON for built-in and `types` types. * `wire` package provides wire protocol implementation. @@ -128,13 +126,13 @@ The `internal` subpackages contain most of the FerretDB code: * `handlers` contains a common interface for backend handlers that they should implement. Handlers use `types` and `wire` packages, but `bson` package details are hidden. * `handlers/common` contains code shared by different handlers. -* `handlers/dummy` contains a stub implementation of that interface that could be copied into a new package - as a starting point for the new handlers. -* `handlers/pg` contains the implementation of the PostgreSQL handler. -* `handlers/pg/pjson` provides converters from/to PJSON for built-in and `types` types. - PJSON adds some extensions to JSON for keeping object keys in order, +* `handlers/sjson` provides converters from/to SJSON for built-in and `types` types. + SJSON adds some extensions to JSON for keeping object keys in order, preserving BSON type information in the values themselves, etc. - It is used by `pg` handler. + It is used by `sqlite` and `pg` handlers. +* `handlers/sqlite` contains the implementation of the SQLite handler. + It is being converted into universal handler for all backends. +* `handlers/pg` contains the implementation of the PostgreSQL handler. * `handlers/tigris` contains the implementation of the Tigris handler. * `handlers/tigris/tjson` provides converters from/to TJSON with JSON Schema for built-in and `types` types. BSON type information is preserved either in the schema (where possible) or in the values themselves. diff --git a/go.mod b/go.mod index e55432f72518..eb4ad395e9a7 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 golang.org/x/net v0.10.0 golang.org/x/sys v0.8.0 + modernc.org/sqlite v1.22.1 ) require ( @@ -34,6 +35,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deepmap/oapi-codegen v1.12.4 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/mock v1.6.0 // indirect @@ -45,18 +47,32 @@ require ( github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/puddle/v2 v2.2.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/prometheus/procfs v0.9.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.6.0 // indirect + golang.org/x/mod v0.8.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/text v0.9.0 // indirect + golang.org/x/tools v0.6.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.54.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.40.0 // indirect + modernc.org/ccgo/v3 v3.16.13 // indirect + modernc.org/libc v1.22.5 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.5.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/strutil v1.1.3 // indirect + modernc.org/token v1.0.1 // indirect ) diff --git a/go.sum b/go.sum index 83eabf1ed0e6..33ed1356e555 100644 --- a/go.sum +++ b/go.sum @@ -39,6 +39,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/deepmap/oapi-codegen v1.12.4 h1:pPmn6qI9MuOtCz82WY2Xaw46EQjgvxednXXrP7g5Q2s= github.com/deepmap/oapi-codegen v1.12.4/go.mod h1:3lgHGMu6myQ2vqbbTXH2H1o4eXFTGnFiDaOaKKl5yas= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -89,6 +91,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -114,6 +117,8 @@ github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgf github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -123,6 +128,9 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 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/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -144,6 +152,9 @@ github.com/prometheus/common v0.43.0 h1:iq+BVjvYLei5f27wiuNiB1DN6DYQkp1c8Bx0Vykh github.com/prometheus/common v0.43.0/go.mod h1:NCvr5cQIh3Y/gy73/RdVtC9r8xxrxwJnB+2lB3BxrFc= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -201,6 +212,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -240,6 +253,7 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -260,6 +274,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -314,3 +330,27 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= +modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= +modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.22.1 h1:P2+Dhp5FR1RlVRkQ3dDfCiv3Ok8XPxqpe70IjYVA9oE= +modernc.org/sqlite v1.22.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= diff --git a/integration/go.mod b/integration/go.mod index dc5da666ab9a..e206bb855d4a 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -28,6 +28,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deepmap/oapi-codegen v1.12.4 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/mock v1.6.0 // indirect @@ -44,7 +45,9 @@ require ( github.com/jackc/pgx/v5 v5.3.1 // indirect github.com/jackc/puddle/v2 v2.2.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.13.6 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -54,6 +57,7 @@ require ( github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.43.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/tigrisdata/tigris-client-go v1.0.0-beta.37 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.1 // indirect @@ -63,14 +67,26 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.9.0 // indirect + golang.org/x/mod v0.8.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect + golang.org/x/tools v0.6.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.54.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.40.0 // indirect + modernc.org/ccgo/v3 v3.16.13 // indirect + modernc.org/libc v1.22.5 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.5.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/sqlite v1.22.1 // indirect + modernc.org/strutil v1.1.3 // indirect + modernc.org/token v1.0.1 // indirect ) diff --git a/integration/go.sum b/integration/go.sum index 0af35c738ebc..82ffffc59aa1 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -35,6 +35,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/deepmap/oapi-codegen v1.12.4 h1:pPmn6qI9MuOtCz82WY2Xaw46EQjgvxednXXrP7g5Q2s= github.com/deepmap/oapi-codegen v1.12.4/go.mod h1:3lgHGMu6myQ2vqbbTXH2H1o4eXFTGnFiDaOaKKl5yas= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -88,6 +90,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -112,6 +115,8 @@ github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgf github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= @@ -123,6 +128,9 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 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/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -147,6 +155,9 @@ github.com/prometheus/common v0.43.0 h1:iq+BVjvYLei5f27wiuNiB1DN6DYQkp1c8Bx0Vykh github.com/prometheus/common v0.43.0/go.mod h1:NCvr5cQIh3Y/gy73/RdVtC9r8xxrxwJnB+2lB3BxrFc= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -225,6 +236,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -266,6 +279,7 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -287,6 +301,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -341,3 +357,27 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= +modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= +modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.22.1 h1:P2+Dhp5FR1RlVRkQ3dDfCiv3Ok8XPxqpe70IjYVA9oE= +modernc.org/sqlite v1.22.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= diff --git a/internal/handlers/registry/hana.go b/internal/handlers/registry/hana.go index 46bd114bfc75..302ca9aba1fc 100644 --- a/internal/handlers/registry/hana.go +++ b/internal/handlers/registry/hana.go @@ -32,6 +32,7 @@ func init() { Metrics: opts.Metrics, StateProvider: opts.StateProvider, } + return hana.New(handlerOpts) } } diff --git a/internal/handlers/registry/pg.go b/internal/handlers/registry/pg.go new file mode 100644 index 000000000000..6d8d6d0811fc --- /dev/null +++ b/internal/handlers/registry/pg.go @@ -0,0 +1,39 @@ +// Copyright 2021 FerretDB Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package registry + +import ( + "github.com/FerretDB/FerretDB/internal/handlers" + "github.com/FerretDB/FerretDB/internal/handlers/pg" +) + +// init registers "pg" handler. +func init() { + registry["pg"] = func(opts *NewHandlerOpts) (handlers.Interface, error) { + handlerOpts := &pg.NewOpts{ + PostgreSQLURL: opts.PostgreSQLURL, + + L: opts.Logger, + Metrics: opts.Metrics, + StateProvider: opts.StateProvider, + + DisableFilterPushdown: opts.DisableFilterPushdown, + EnableSortPushdown: opts.EnableSortPushdown, + EnableCursors: opts.EnableCursors, + } + + return pg.New(handlerOpts) + } +} diff --git a/internal/handlers/registry/registry.go b/internal/handlers/registry/registry.go index 7893cdd38a30..407f23279379 100644 --- a/internal/handlers/registry/registry.go +++ b/internal/handlers/registry/registry.go @@ -24,8 +24,6 @@ import ( "github.com/FerretDB/FerretDB/internal/clientconn/connmetrics" "github.com/FerretDB/FerretDB/internal/handlers" - "github.com/FerretDB/FerretDB/internal/handlers/dummy" - "github.com/FerretDB/FerretDB/internal/handlers/pg" "github.com/FerretDB/FerretDB/internal/util/state" ) @@ -86,25 +84,3 @@ func Handlers() []string { slices.Sort(handlers) return handlers } - -// init registers handlers that are always enabled. -func init() { - registry["dummy"] = func(opts *NewHandlerOpts) (handlers.Interface, error) { - return dummy.New(opts.Logger) - } - - registry["pg"] = func(opts *NewHandlerOpts) (handlers.Interface, error) { - handlerOpts := &pg.NewOpts{ - PostgreSQLURL: opts.PostgreSQLURL, - - L: opts.Logger, - Metrics: opts.Metrics, - StateProvider: opts.StateProvider, - - DisableFilterPushdown: opts.DisableFilterPushdown, - EnableSortPushdown: opts.EnableSortPushdown, - EnableCursors: opts.EnableCursors, - } - return pg.New(handlerOpts) - } -} diff --git a/internal/handlers/registry/sqlite.go b/internal/handlers/registry/sqlite.go new file mode 100644 index 000000000000..4fbe65bbe0e3 --- /dev/null +++ b/internal/handlers/registry/sqlite.go @@ -0,0 +1,31 @@ +// Copyright 2021 FerretDB Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package registry + +import ( + _ "modernc.org/sqlite" // TODO move this to backend package + + "github.com/FerretDB/FerretDB/internal/handlers" + "github.com/FerretDB/FerretDB/internal/handlers/sqlite" +) + +// init registers "sqlite" handler. +func init() { + registry["sqlite"] = func(opts *NewHandlerOpts) (handlers.Interface, error) { + opts.Logger.Warn("SQLite handler is in alpha. It is not supported yet.") + + return sqlite.New(opts.Logger) + } +} diff --git a/internal/handlers/registry/tigris.go b/internal/handlers/registry/tigris.go index e188ac40671a..0e93a6394f26 100644 --- a/internal/handlers/registry/tigris.go +++ b/internal/handlers/registry/tigris.go @@ -40,6 +40,7 @@ func init() { DisableFilterPushdown: opts.DisableFilterPushdown, EnableCursors: opts.EnableCursors, } + return tigris.New(handlerOpts) } } diff --git a/internal/handlers/dummy/cmd_query.go b/internal/handlers/sqlite/cmd_query.go similarity index 98% rename from internal/handlers/dummy/cmd_query.go rename to internal/handlers/sqlite/cmd_query.go index ce71fb1a72a8..77858e44899e 100644 --- a/internal/handlers/dummy/cmd_query.go +++ b/internal/handlers/sqlite/cmd_query.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_aggregate.go b/internal/handlers/sqlite/msg_aggregate.go similarity index 98% rename from internal/handlers/dummy/msg_aggregate.go rename to internal/handlers/sqlite/msg_aggregate.go index 914c4e61eb5d..3b88b7665a1e 100644 --- a/internal/handlers/dummy/msg_aggregate.go +++ b/internal/handlers/sqlite/msg_aggregate.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_buildinfo.go b/internal/handlers/sqlite/msg_buildinfo.go similarity index 98% rename from internal/handlers/dummy/msg_buildinfo.go rename to internal/handlers/sqlite/msg_buildinfo.go index 4222588e6af0..0ee56140ef47 100644 --- a/internal/handlers/dummy/msg_buildinfo.go +++ b/internal/handlers/sqlite/msg_buildinfo.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_collmod.go b/internal/handlers/sqlite/msg_collmod.go similarity index 98% rename from internal/handlers/dummy/msg_collmod.go rename to internal/handlers/sqlite/msg_collmod.go index 6918e9053b71..d41eb56e4fc0 100644 --- a/internal/handlers/dummy/msg_collmod.go +++ b/internal/handlers/sqlite/msg_collmod.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_collstats.go b/internal/handlers/sqlite/msg_collstats.go similarity index 98% rename from internal/handlers/dummy/msg_collstats.go rename to internal/handlers/sqlite/msg_collstats.go index ded3e831bdf7..33739d0bb074 100644 --- a/internal/handlers/dummy/msg_collstats.go +++ b/internal/handlers/sqlite/msg_collstats.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_connectionstatus.go b/internal/handlers/sqlite/msg_connectionstatus.go similarity index 98% rename from internal/handlers/dummy/msg_connectionstatus.go rename to internal/handlers/sqlite/msg_connectionstatus.go index 3d5f3b802458..88105988b9bc 100644 --- a/internal/handlers/dummy/msg_connectionstatus.go +++ b/internal/handlers/sqlite/msg_connectionstatus.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_count.go b/internal/handlers/sqlite/msg_count.go similarity index 98% rename from internal/handlers/dummy/msg_count.go rename to internal/handlers/sqlite/msg_count.go index 7f76a3858493..505eb939e132 100644 --- a/internal/handlers/dummy/msg_count.go +++ b/internal/handlers/sqlite/msg_count.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_create.go b/internal/handlers/sqlite/msg_create.go similarity index 98% rename from internal/handlers/dummy/msg_create.go rename to internal/handlers/sqlite/msg_create.go index eaf74e97e228..f68f0c0dadb5 100644 --- a/internal/handlers/dummy/msg_create.go +++ b/internal/handlers/sqlite/msg_create.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_createindexes.go b/internal/handlers/sqlite/msg_createindexes.go similarity index 98% rename from internal/handlers/dummy/msg_createindexes.go rename to internal/handlers/sqlite/msg_createindexes.go index c8c3f9e90695..6568182c9736 100644 --- a/internal/handlers/dummy/msg_createindexes.go +++ b/internal/handlers/sqlite/msg_createindexes.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_currentop.go b/internal/handlers/sqlite/msg_currentop.go similarity index 98% rename from internal/handlers/dummy/msg_currentop.go rename to internal/handlers/sqlite/msg_currentop.go index 99f45e7ce797..2bb7f22e8cde 100644 --- a/internal/handlers/dummy/msg_currentop.go +++ b/internal/handlers/sqlite/msg_currentop.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_datasize.go b/internal/handlers/sqlite/msg_datasize.go similarity index 98% rename from internal/handlers/dummy/msg_datasize.go rename to internal/handlers/sqlite/msg_datasize.go index 55cbfb0beca6..6719ad090311 100644 --- a/internal/handlers/dummy/msg_datasize.go +++ b/internal/handlers/sqlite/msg_datasize.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_dbstats.go b/internal/handlers/sqlite/msg_dbstats.go similarity index 98% rename from internal/handlers/dummy/msg_dbstats.go rename to internal/handlers/sqlite/msg_dbstats.go index 913751e5c1da..e262026b2a5a 100644 --- a/internal/handlers/dummy/msg_dbstats.go +++ b/internal/handlers/sqlite/msg_dbstats.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_debugerror.go b/internal/handlers/sqlite/msg_debugerror.go similarity index 98% rename from internal/handlers/dummy/msg_debugerror.go rename to internal/handlers/sqlite/msg_debugerror.go index 6bd59937ae95..2710ba3fe28f 100644 --- a/internal/handlers/dummy/msg_debugerror.go +++ b/internal/handlers/sqlite/msg_debugerror.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_delete.go b/internal/handlers/sqlite/msg_delete.go similarity index 98% rename from internal/handlers/dummy/msg_delete.go rename to internal/handlers/sqlite/msg_delete.go index b1442e9d4c85..261b588d9f51 100644 --- a/internal/handlers/dummy/msg_delete.go +++ b/internal/handlers/sqlite/msg_delete.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_distinct.go b/internal/handlers/sqlite/msg_distinct.go similarity index 98% rename from internal/handlers/dummy/msg_distinct.go rename to internal/handlers/sqlite/msg_distinct.go index 3228aedf557f..903ca0e2ef2c 100644 --- a/internal/handlers/dummy/msg_distinct.go +++ b/internal/handlers/sqlite/msg_distinct.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_drop.go b/internal/handlers/sqlite/msg_drop.go similarity index 98% rename from internal/handlers/dummy/msg_drop.go rename to internal/handlers/sqlite/msg_drop.go index 6e2ea2589cb2..e3a96f2a354f 100644 --- a/internal/handlers/dummy/msg_drop.go +++ b/internal/handlers/sqlite/msg_drop.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_dropdatabase.go b/internal/handlers/sqlite/msg_dropdatabase.go similarity index 98% rename from internal/handlers/dummy/msg_dropdatabase.go rename to internal/handlers/sqlite/msg_dropdatabase.go index faa9df8f7c3c..4164994a8567 100644 --- a/internal/handlers/dummy/msg_dropdatabase.go +++ b/internal/handlers/sqlite/msg_dropdatabase.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_dropindexes.go b/internal/handlers/sqlite/msg_dropindexes.go similarity index 98% rename from internal/handlers/dummy/msg_dropindexes.go rename to internal/handlers/sqlite/msg_dropindexes.go index 469c25e202b4..bd0ad90defaa 100644 --- a/internal/handlers/dummy/msg_dropindexes.go +++ b/internal/handlers/sqlite/msg_dropindexes.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_explain.go b/internal/handlers/sqlite/msg_explain.go similarity index 98% rename from internal/handlers/dummy/msg_explain.go rename to internal/handlers/sqlite/msg_explain.go index da91a7982969..44def4c6f160 100644 --- a/internal/handlers/dummy/msg_explain.go +++ b/internal/handlers/sqlite/msg_explain.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_find.go b/internal/handlers/sqlite/msg_find.go similarity index 98% rename from internal/handlers/dummy/msg_find.go rename to internal/handlers/sqlite/msg_find.go index 2810d6dd13ca..bbf615713bbe 100644 --- a/internal/handlers/dummy/msg_find.go +++ b/internal/handlers/sqlite/msg_find.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_findandmodify.go b/internal/handlers/sqlite/msg_findandmodify.go similarity index 98% rename from internal/handlers/dummy/msg_findandmodify.go rename to internal/handlers/sqlite/msg_findandmodify.go index d1fb9fccb8d5..41a640435de0 100644 --- a/internal/handlers/dummy/msg_findandmodify.go +++ b/internal/handlers/sqlite/msg_findandmodify.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_getcmdlineopts.go b/internal/handlers/sqlite/msg_getcmdlineopts.go similarity index 98% rename from internal/handlers/dummy/msg_getcmdlineopts.go rename to internal/handlers/sqlite/msg_getcmdlineopts.go index 09fe7e558275..e74a92e358af 100644 --- a/internal/handlers/dummy/msg_getcmdlineopts.go +++ b/internal/handlers/sqlite/msg_getcmdlineopts.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_getfreemonitoringstatus.go b/internal/handlers/sqlite/msg_getfreemonitoringstatus.go similarity index 98% rename from internal/handlers/dummy/msg_getfreemonitoringstatus.go rename to internal/handlers/sqlite/msg_getfreemonitoringstatus.go index 2607e5c6fc7f..f2c7818ee309 100644 --- a/internal/handlers/dummy/msg_getfreemonitoringstatus.go +++ b/internal/handlers/sqlite/msg_getfreemonitoringstatus.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_getlog.go b/internal/handlers/sqlite/msg_getlog.go similarity index 98% rename from internal/handlers/dummy/msg_getlog.go rename to internal/handlers/sqlite/msg_getlog.go index fce188dca95e..b5854cca1533 100644 --- a/internal/handlers/dummy/msg_getlog.go +++ b/internal/handlers/sqlite/msg_getlog.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_getmore.go b/internal/handlers/sqlite/msg_getmore.go similarity index 98% rename from internal/handlers/dummy/msg_getmore.go rename to internal/handlers/sqlite/msg_getmore.go index 61be0cd38ea4..10507019c446 100644 --- a/internal/handlers/dummy/msg_getmore.go +++ b/internal/handlers/sqlite/msg_getmore.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_getparameter.go b/internal/handlers/sqlite/msg_getparameter.go similarity index 98% rename from internal/handlers/dummy/msg_getparameter.go rename to internal/handlers/sqlite/msg_getparameter.go index 67c38243b3ea..5ee07c131792 100644 --- a/internal/handlers/dummy/msg_getparameter.go +++ b/internal/handlers/sqlite/msg_getparameter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_hello.go b/internal/handlers/sqlite/msg_hello.go similarity index 98% rename from internal/handlers/dummy/msg_hello.go rename to internal/handlers/sqlite/msg_hello.go index 56e5007f3597..8bb4cb6c60e3 100644 --- a/internal/handlers/dummy/msg_hello.go +++ b/internal/handlers/sqlite/msg_hello.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_hostinfo.go b/internal/handlers/sqlite/msg_hostinfo.go similarity index 98% rename from internal/handlers/dummy/msg_hostinfo.go rename to internal/handlers/sqlite/msg_hostinfo.go index 8448f04cf1e2..90620adab9f9 100644 --- a/internal/handlers/dummy/msg_hostinfo.go +++ b/internal/handlers/sqlite/msg_hostinfo.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_insert.go b/internal/handlers/sqlite/msg_insert.go similarity index 98% rename from internal/handlers/dummy/msg_insert.go rename to internal/handlers/sqlite/msg_insert.go index fd77e174dd53..a3b9d031fd30 100644 --- a/internal/handlers/dummy/msg_insert.go +++ b/internal/handlers/sqlite/msg_insert.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_ismaster.go b/internal/handlers/sqlite/msg_ismaster.go similarity index 98% rename from internal/handlers/dummy/msg_ismaster.go rename to internal/handlers/sqlite/msg_ismaster.go index 8a5cb8d60d8e..3229553ad0f3 100644 --- a/internal/handlers/dummy/msg_ismaster.go +++ b/internal/handlers/sqlite/msg_ismaster.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_listcollections.go b/internal/handlers/sqlite/msg_listcollections.go similarity index 98% rename from internal/handlers/dummy/msg_listcollections.go rename to internal/handlers/sqlite/msg_listcollections.go index 33433488fedf..116b5fca687c 100644 --- a/internal/handlers/dummy/msg_listcollections.go +++ b/internal/handlers/sqlite/msg_listcollections.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_listcommands.go b/internal/handlers/sqlite/msg_listcommands.go similarity index 98% rename from internal/handlers/dummy/msg_listcommands.go rename to internal/handlers/sqlite/msg_listcommands.go index 0d6ea7fce610..9931edaf984f 100644 --- a/internal/handlers/dummy/msg_listcommands.go +++ b/internal/handlers/sqlite/msg_listcommands.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_listdatabases.go b/internal/handlers/sqlite/msg_listdatabases.go similarity index 98% rename from internal/handlers/dummy/msg_listdatabases.go rename to internal/handlers/sqlite/msg_listdatabases.go index 4b83cee88ada..417759e30430 100644 --- a/internal/handlers/dummy/msg_listdatabases.go +++ b/internal/handlers/sqlite/msg_listdatabases.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_listindexes.go b/internal/handlers/sqlite/msg_listindexes.go similarity index 98% rename from internal/handlers/dummy/msg_listindexes.go rename to internal/handlers/sqlite/msg_listindexes.go index 02d51cdf440d..c69650721645 100644 --- a/internal/handlers/dummy/msg_listindexes.go +++ b/internal/handlers/sqlite/msg_listindexes.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_ping.go b/internal/handlers/sqlite/msg_ping.go similarity index 98% rename from internal/handlers/dummy/msg_ping.go rename to internal/handlers/sqlite/msg_ping.go index 0148646288a7..f394140c6e21 100644 --- a/internal/handlers/dummy/msg_ping.go +++ b/internal/handlers/sqlite/msg_ping.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_renamecollection.go b/internal/handlers/sqlite/msg_renamecollection.go similarity index 98% rename from internal/handlers/dummy/msg_renamecollection.go rename to internal/handlers/sqlite/msg_renamecollection.go index e161e3912d31..3a4fba8506b1 100644 --- a/internal/handlers/dummy/msg_renamecollection.go +++ b/internal/handlers/sqlite/msg_renamecollection.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_saslstart.go b/internal/handlers/sqlite/msg_saslstart.go similarity index 98% rename from internal/handlers/dummy/msg_saslstart.go rename to internal/handlers/sqlite/msg_saslstart.go index ed36ae065888..c8eb164c1c00 100644 --- a/internal/handlers/dummy/msg_saslstart.go +++ b/internal/handlers/sqlite/msg_saslstart.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_serverstatus.go b/internal/handlers/sqlite/msg_serverstatus.go similarity index 98% rename from internal/handlers/dummy/msg_serverstatus.go rename to internal/handlers/sqlite/msg_serverstatus.go index 7da7c1d2c5cb..f932348112bf 100644 --- a/internal/handlers/dummy/msg_serverstatus.go +++ b/internal/handlers/sqlite/msg_serverstatus.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_setfreemonitoring.go b/internal/handlers/sqlite/msg_setfreemonitoring.go similarity index 98% rename from internal/handlers/dummy/msg_setfreemonitoring.go rename to internal/handlers/sqlite/msg_setfreemonitoring.go index 1ceb21f6b098..8d01692fc9e8 100644 --- a/internal/handlers/dummy/msg_setfreemonitoring.go +++ b/internal/handlers/sqlite/msg_setfreemonitoring.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_update.go b/internal/handlers/sqlite/msg_update.go similarity index 98% rename from internal/handlers/dummy/msg_update.go rename to internal/handlers/sqlite/msg_update.go index b56907cee834..5919ad78a4b3 100644 --- a/internal/handlers/dummy/msg_update.go +++ b/internal/handlers/sqlite/msg_update.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_validate.go b/internal/handlers/sqlite/msg_validate.go similarity index 98% rename from internal/handlers/dummy/msg_validate.go rename to internal/handlers/sqlite/msg_validate.go index 77bdf109bf44..7a5e07f5aad0 100644 --- a/internal/handlers/dummy/msg_validate.go +++ b/internal/handlers/sqlite/msg_validate.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/msg_whatsmyuri.go b/internal/handlers/sqlite/msg_whatsmyuri.go similarity index 98% rename from internal/handlers/dummy/msg_whatsmyuri.go rename to internal/handlers/sqlite/msg_whatsmyuri.go index 0ed585e25353..fed42e1fddd1 100644 --- a/internal/handlers/dummy/msg_whatsmyuri.go +++ b/internal/handlers/sqlite/msg_whatsmyuri.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import ( "context" diff --git a/internal/handlers/dummy/dummy.go b/internal/handlers/sqlite/sqlite.go similarity index 91% rename from internal/handlers/dummy/dummy.go rename to internal/handlers/sqlite/sqlite.go index 288503139eb7..b451dfada372 100644 --- a/internal/handlers/dummy/dummy.go +++ b/internal/handlers/sqlite/sqlite.go @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package dummy provides a basic handler implementation. +// Package sqlite provides SQLite handler. // -// The whole package can be copied to start a new handler implementation. -package dummy +// It is being converted into universal handler for all backends. +package sqlite import ( "go.uber.org/zap" diff --git a/internal/handlers/dummy/dummy_test.go b/internal/handlers/sqlite/sqlite_test.go similarity index 97% rename from internal/handlers/dummy/dummy_test.go rename to internal/handlers/sqlite/sqlite_test.go index ffe0973c2a55..94c2c9d3af10 100644 --- a/internal/handlers/dummy/dummy_test.go +++ b/internal/handlers/sqlite/sqlite_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dummy +package sqlite import "testing" diff --git a/website/docs/configuration/flags.md b/website/docs/configuration/flags.md index 5a289fd849de..61c49f3e3073 100644 --- a/website/docs/configuration/flags.md +++ b/website/docs/configuration/flags.md @@ -43,6 +43,8 @@ Some default values are overridden in [our Docker image](quickstart-guide/docker ## Backend handlers + + ### PostgreSQL [PostgreSQL backend](../understanding-ferretdb.md#postgresql) can be enabled by diff --git a/website/docs/understanding-ferretdb.md b/website/docs/understanding-ferretdb.md index 2aefe13434f8..3a339172ce7e 100644 --- a/website/docs/understanding-ferretdb.md +++ b/website/docs/understanding-ferretdb.md @@ -168,6 +168,11 @@ MongoDB documents are mapped to rows with a single [JSONB](https://www.postgresq Those mappings might change as we work on improving compatibility and performance, but no breaking changes will be introduced without a major version bump. +### SQLite (alpha) + +We are [working on](https://github.com/FerretDB/FerretDB/issues/2387) SQLite backend. +It is not officially supported yet. + ### Tigris (beta) We also support the [Tigris](https://www.tigrisdata.com) backend on a beta level.