Skip to content

Commit

Permalink
[HYD-187] Add support of multicorn gsspreadsheet fdw (#15)
Browse files Browse the repository at this point in the history
* Get mysql build to run

* Enable mysql_fdw by default

* Replace Docker container with Docker Compose in acceptance tests

This slides in mysql container that is accessible from hydra

* Move http ext tests to main acceptance test cases

* Always run docker compose down to clean up networks

* Rename to `profileName`

* Add `mysql_fdw` tests to verify direct connection

* Only start all containers for acceptance tests

* Remove test docker-compose.yaml

* Remove unused import

* Bump `github.com/jackc/pgx` to consume bug fixes

* Validate mysql_fdw only return one row

* Remove vendor

* Use text/template

* Move `docker compose down` after kill

* Expand flags

* Fix bug that use `--profile` instead of `--project-name`

* Make `http` & `mysql_fdw` ext behavior consistent with `postgres_fdw`

* Disable preload
* Extensions are not loaded by default (require explicit `CREATE EXTENSION` statements)

* Multicorn build

* Get spilo build to work with multicorn

* Enable multicorn ext for spilo

* Add multicorn create foreign table acceptance test

* Do not enable `multicorn` ext by default

* Tag multicorn2 to v2.4

* Pin s3csv_fdw to the latest commit

* Add support of multicorn gspreadsheet fdw

Add support of multicorn gspreadsheet fdw
  • Loading branch information
owenthereal authored Nov 7, 2022
1 parent 92ae91e commit 1d7cb47
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
18 changes: 17 additions & 1 deletion acceptance/shared/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ SELECT count(1) FROM pg_extension WHERE extname = 'multicorn';
},
},
{
Name: "create multicorn ext foreign table",
Name: "create multicorn s3 ext foreign table",
SQL: `
CREATE SERVER multicorn_s3 FOREIGN DATA WRAPPER multicorn
options (
Expand All @@ -334,6 +334,22 @@ create foreign table s3 (
aws_secret_key 'FAKE',
bucket 'test-bucket',
filename 'test.csv'
);
`,
},
{
Name: "create multicorn gspreadsheet ext foreign table",
SQL: `
CREATE SERVER multicorn_gspreadsheet FOREIGN DATA WRAPPER multicorn
options (
wrapper 'gspreadsheet_fdw.GspreadsheetFdw' );
CREATE FOREIGN TABLE test_spreadsheet (
id character varying,
name character varying
) server multicorn_gspreadsheet options(
gskey '1234',
serviceaccount '{}'
);
`,
},
Expand Down
1 change: 1 addition & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ target "multicorn" {
PYTHON_VERSION = "${PYTHON_VERSION}"
MULTICORN_TAG = "v2.4"
S3CSV_FDW_COMMIT = "08ca3c082e2bfaa9ae60303fed67800c29a6fe6c"
GSPREADSHEET_FDW_COMMIT = "d5bc5ae0b2d189abd6d2ee4610bd96ec39602594"
}
}

Expand Down
13 changes: 12 additions & 1 deletion multicorn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG MYSQL_FDW_TAG
ARG MULTICORN_TAG
ARG PYTHON_VERSION
ARG S3CSV_FDW_COMMIT
ARG GSPREADSHEET_FDW_COMMIT
ARG POSTGRES_BASE_VERSION=14

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install gnupg postgresql-common git -y
Expand Down Expand Up @@ -45,7 +46,17 @@ RUN git clone https://github.com/pgsql-io/multicorn2 && \
DESTDIR=/pg_ext USE_PGXS=1 make install

# install runtime python deps
RUN python3 -m pip install git+https://github.com/eligoenergy/s3csv_fdw.git@${S3CSV_FDW_COMMIT}
RUN python3 -m pip install \
git+https://github.com/eligoenergy/s3csv_fdw.git@${S3CSV_FDW_COMMIT} \
# gspreadsheet_fdw deps
gspread \
oauth2client

# Use a fork
RUN git clone https://github.com/HydrasDB/gspreadsheet_fdw && \
cd gspreadsheet_fdw && \
git checkout ${GSPREADSHEET_FDW_COMMIT} && \
python3 setup.py install

FROM scratch as output

Expand Down

0 comments on commit 1d7cb47

Please sign in to comment.