Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit b5628e2

Browse files
authored
Importing v2 to our main Quesma instance (#1051)
Establish the way for importing `v2` and fixing the build so that rest of you won't have to get through the toil of GoLand rewriting paths and trying to be smarter than you.
1 parent 8144a02 commit b5628e2

32 files changed

+99
-7
lines changed

quesma/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ FROM golang:alpine AS builder
22

33

44
WORKDIR /quesma
5+
## v2 is a seprate module, not package
6+
COPY v2/go.mod v2/go.mod
7+
COPY v2/go.sum v2/go.sum
58

69
COPY go.mod go.sum ./
710

quesma/go.mod

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ module quesma
22

33
go 1.23.2
44

5+
replace quesma_v2 => ./v2
6+
57
require (
68
github.com/ClickHouse/clickhouse-go/v2 v2.30.0
79
github.com/DATA-DOG/go-sqlmock v1.5.2
810
github.com/DataDog/go-sqllexer v0.0.17
911
github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df
1012
github.com/coreos/go-semver v0.3.1
13+
github.com/goccy/go-json v0.10.3
1114
github.com/google/uuid v1.6.0
1215
github.com/gorilla/mux v1.8.1
1316
github.com/gorilla/securecookie v1.1.2
@@ -25,14 +28,15 @@ require (
2528
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a
2629
github.com/tidwall/sjson v1.2.5
2730
github.com/ucarion/urlpath v0.0.0-20200424170820-7ccc79b76bbb
28-
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
31+
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
2932
golang.org/x/oauth2 v0.24.0
33+
quesma_v2 v0.0.0-00010101000000-000000000000
3034
)
3135

3236
require (
3337
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
34-
github.com/goccy/go-json v0.10.3 // indirect
3538
github.com/hashicorp/errwrap v1.0.0 // indirect
39+
github.com/jackc/pgx/v5 v5.7.1 // indirect
3640
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
3741
github.com/knadh/koanf/maps v0.1.1 // indirect
3842
github.com/kr/text v0.2.0 // indirect

quesma/go.sum

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/U
5757
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
5858
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
5959
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
60+
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
61+
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
62+
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
63+
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
64+
github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs=
65+
github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA=
6066
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=
6167
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
6268
github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40=
@@ -111,8 +117,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
111117
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
112118
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
113119
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
114-
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
115-
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
120+
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
121+
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
116122
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
117123
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
118124
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
@@ -168,8 +174,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
168174
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
169175
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
170176
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
171-
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
172-
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
177+
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
178+
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
179+
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
180+
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
173181
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
174182
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
175183
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -203,6 +211,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
203211
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
204212
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
205213
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
214+
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
215+
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
206216
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
207217
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
208218
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=

quesma/main.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import (
2828
"quesma/table_resolver"
2929
"quesma/telemetry"
3030
"quesma/tracing"
31+
"quesma_v2/core"
32+
"quesma_v2/frontend_connectors"
3133
"runtime"
3234
"syscall"
3335
"time"
@@ -44,8 +46,16 @@ const banner = `
4446

4547
const EnableConcurrencyProfiling = false
4648

47-
func main() {
49+
// buildIngestOnlyQuesma is for now a helper function to help establishing the way of v2 module api import
50+
func buildIngestOnlyQuesma() quesma_api.QuesmaBuilder {
51+
var quesmaBuilder quesma_api.QuesmaBuilder = quesma_api.NewQuesma()
52+
_ = frontend_connectors.NewBasicHTTPFrontendConnector(":8080")
53+
_ = frontend_connectors.NewHTTPRouter()
54+
quesmaInstance, _ := quesmaBuilder.Build()
55+
return quesmaInstance
56+
}
4857

58+
func main() {
4959
if EnableConcurrencyProfiling {
5060
runtime.SetBlockProfileRate(1)
5161
runtime.SetMutexProfileFraction(1)

quesma/main_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright Quesma, licensed under the Elastic License 2.0.
2+
// SPDX-License-Identifier: Elastic-2.0
3+
4+
package main
5+
6+
import "testing"
7+
8+
// just to make sure that the buildIngestOnlyQuesma is used
9+
func TestMain(m *testing.M) {
10+
_ = buildIngestOnlyQuesma()
11+
}

v2/backend_connectors/mysql_backend_connector.go renamed to quesma/v2/backend_connectors/mysql_backend_connector.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright Quesma, licensed under the Elastic License 2.0.
2+
// SPDX-License-Identifier: Elastic-2.0
3+
14
package backend_connectors
25

36
import (

v2/backend_connectors/postgres_backend_connector.go renamed to quesma/v2/backend_connectors/postgres_backend_connector.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright Quesma, licensed under the Elastic License 2.0.
2+
// SPDX-License-Identifier: Elastic-2.0
3+
14
package backend_connectors
25

36
import (
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)