keboola / storage-driver-teradata
Keboola teradata driver
Requires
- php: ^8.1
- ext-json: *
- ext-odbc: *
- google/protobuf: ^3.21
- keboola/db-import-export: ^2
- keboola/php-file-storage-utils: ^0.2.5
- keboola/storage-driver-common: ^6.0
- keboola/table-backend-utils: ^2
Requires (Dev)
- keboola/coding-standard: ^13.0
- keboola/phpunit-retry-annotations: ^0.3.0
- php-parallel-lint/php-parallel-lint: ^1.3
- phpstan/phpstan: ^1.4
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-symfony: ^1.1
- phpunit/phpunit: ^9
- symfony/finder: ^5.4
- dev-main
- v5.0.0
- v4.0.0
- v3.0.0
- v2.0.0
- v1.14.0
- v1.13.0
- v1.12.0
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.9.1
- v0.9.0
- v0.8.0
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7
- v0.6
- v0.5.1
- v0.5
- v0.4
- v0.3
- v0.2
- v0.1.1
- v0.1
- dev-dependabot/github_actions/dot-github/workflows/actions/download-artifact-4.1.7
- dev-CT-807-PHP8
- dev-jirka-return-dbs-not-schemas
- dev-TER-60-tables-definition-endpoint
- dev-test-build
- dev-zajca-kbc-2874
- dev-zajca-file-load
- dev-mj-init-backend-fix-rights
- dev-zajca-protobuf-2
- dev-zajca-init
This package is auto-updated.
Last update: 2024-11-03 22:13:30 UTC
README
Keboola high level storage backend driver for Teradata
Setup Teradata
-- set session database of your choice SET SESSION DATABASE <your root database>; --There are two options how to preceded -- Option 1 (preferred): Create user and run all tests with it CREATE USER <nickname>_driver_teradata FROM <your root database> AS PERMANENT = 1e9, SPOOL = 1e9 PASSWORD = PassW0rd#, -- set your password :) DEFAULT DATABASE=<nickname>_driver_teradata; -- grant rights GRANT CREATE DATABASE, DROP DATABASE, CREATE USER, DROP USER ON <nickname>_driver_teradata TO <nickname>_driver_teradata; GRANT CREATE ROLE, DROP ROLE TO <nickname>_driver_teradata WITH GRANT OPTION; GRANT EXECUTE ON SPECIFIC FUNCTION SYSLIB.AbortSessions TO <nickname>_driver_teradata WITH GRANT OPTION; -- Option 2: Create database and use you current user to run tests -- you use has to have CREATE DATABASE, DROP DATABASE, CREATE USER, DROP USER, CREATE ROLE, DROP ROLE grants -- create root database for driver, use memory allocation of you choice CREATE DATABASE <nickname>_driver_teradata FROM <your root database> AS PERMANENT = 1e9, SPOOL = 1e9;
setup envs:
TERADATA_HOST=
TERADATA_USERNAME=
TERADATA_PASSWORD=
TERADATA_PORT=1025
TERADATA_ROOT_DATABASE=<nickname>_driver_teradata
Mac: for local Teradata server in VirtualBox set HOST to host.docker.internal
.
Setup AWS credentials
You access key must have access to keboola-drivers
bucket to download Teradata odbc driver and utilities
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
# bucket is needed for import/export tests
AWS_S3_BUCKET=
AWS_REGION=eu-central-1
Build docker images
docker-compose build
Xdebug
To run with xdebug use dev-xdebug
container instead of dev
Generate protobuf code
docker-compose run --rm dev composer protobuf
Generate protobuf documentation
Documentation will be placed in docs
folder. Check documentation for more options.
docker run --rm \ -v $(pwd)/docs:/out \ -v $(pwd)/proto:/protos \ pseudomuto/protoc-gen-doc
Tests
Run tests with following command.
docker-compose run --rm dev composer tests
To run separate tests first generate testing protobuf classes
docker-compose run --rm dev composer protobufTests
And than run phpunit
docker-compose run --rm dev composer phpunit -- --filter=TeradataDriverClientTest
To disable retry copy phpunit-retry.xml.dist
cp phpunit-retry.xml.dist phpunit-retry.xml
Debug queries
To debug queries executed during test set DEBUG=1 env variable
Code quality check
#run all bellow but not tests docker-compose run --rm dev composer check #phplint docker-compose run --rm dev composer phplint #phpcs docker-compose run --rm dev composer phpcs #phpcbf docker-compose run --rm dev composer phpcbf #phpstan docker-compose run --rm dev composer phpstan
Full CI workflow
This command will run all checks and run tests
docker-compose run --rm dev composer ci
License
MIT licensed, see LICENSE file.