-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add connection creation endpoint
- Loading branch information
Showing
20 changed files
with
1,016 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# version | ||
GOLANG_VERSION=1.22.5 | ||
K6_VERSION=0.42.0 | ||
|
||
# service | ||
SERVICE_NAME=pipeline-backend | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ WORKDIR /${SERVICE_NAME} | |
|
||
# -- install 3rd-party | ||
|
||
ARG TARGETOS TARGETARCH K6_VERSION | ||
ARG TARGETOS TARGETARCH | ||
|
||
# Install Python, create virtual environment, and install pdfplumber | ||
RUN apt update && \ | ||
|
@@ -34,8 +34,8 @@ RUN npm install -g @opendocsg/pdf2md | |
RUN --mount=target=. --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg GOOS=$TARGETOS GOARCH=$TARGETARCH go install github.com/cosmtrek/[email protected] | ||
|
||
# k6 | ||
ADD https://github.com/grafana/k6/releases/download/v${K6_VERSION}/k6-v${K6_VERSION}-linux-$TARGETARCH.tar.gz k6-v${K6_VERSION}-linux-$TARGETARCH.tar.gz | ||
RUN tar -xf k6-v${K6_VERSION}-linux-$TARGETARCH.tar.gz --strip-components 1 -C /usr/bin | ||
RUN go install go.k6.io/xk6/cmd/[email protected] | ||
RUN xk6 build --with github.com/grafana/xk6-sql --output /usr/bin/k6 | ||
|
||
# -- set up Go | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
BEGIN; | ||
|
||
DROP INDEX IF EXISTS unique_connection_id_namespace; | ||
DROP TABLE IF EXISTS connection; | ||
DROP TYPE valid_connection_method; | ||
|
||
COMMIT; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
BEGIN; | ||
|
||
CREATE TYPE valid_connection_method AS ENUM ( | ||
'METHOD_DICTIONARY', | ||
'METHOD_OAUTH' | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS connection ( | ||
uid UUID PRIMARY KEY, | ||
id VARCHAR(255) NOT NULL, | ||
namespace_uid UUID NOT NULL, | ||
integration_uid UUID NOT NULL REFERENCES component_definition_index, | ||
method valid_connection_method NOT NULL, | ||
setup JSONB NOT NULL, | ||
create_time TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
update_time TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
delete_time TIMESTAMPTZ | ||
); | ||
|
||
CREATE UNIQUE INDEX unique_connection_id_namespace ON connection (id, namespace_uid) WHERE delete_time IS NULL; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.