keboola / db-writer-adapter
MyComponent description
Installs: 494
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
pkg:composer/keboola/db-writer-adapter
Requires
- php: ^8.2
- ext-mbstring: *
- keboola/db-writer-config: ^0.1.0
- keboola/php-component: ^9.0
- keboola/retry: ^0.5.1
- psr/log: ^1.1
Requires (Dev)
- cweagans/composer-patches: ^1.7
- ihsw/toxiproxy-php-client: ^2.0
- keboola/coding-standard: >=7.0.2
- keboola/csv: ^4.0
- keboola/datadir-tests: ^5.3
- keboola/php-temp: ^2.0
- php-parallel-lint/php-parallel-lint: ^1.3
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.5
- symfony/filesystem: ^6.3
- symfony/process: ^5.0
- symplify/vendor-patches: ^11.3
README
This library contains a common interface for connecting to database and writing data to, various sources:
- It is intended for use with db-writer-common.
- It supports PDO and ODBC connections for now.
- The interfaces defined in this library can be easily used to support other methods, e.g. cli BCP tool.
Main Classes
- Interface
Connectionis an abstraction that represents a connection to the database.- Abstract class
BaseConnectioncontains common code and retry mechanisms. - Class
PdoConnectionimplements connection using PDO extension. - Class
OdbcConnectionimplements connection using ODBC extension.
- Abstract class
- Interface
WriteAdapteris an abstraction which defines how the data is written.- Abstract class
BaseWriteAdaptercontains common code. - Class
PdoWriteAdapterimplements write for PDO connection. - Class
OdbcWriteAdapterimplements write for ODBC connection.
- Abstract class
- Interface
QueryBuilderused to generate SQL query for adapter.- Class
DefaultQueryFactoryis base implementation for MySQL/MariaDb compatible SQL dialects.
- Class
Development
Clone this repository and init the workspace with following command:
git clone https://github.com/keboola/db-writer-adapter
cd db-writer-adapter
docker-compose build
docker-compose run --rm dev composer install --no-scripts
Run the test suite using this command:
docker-compose run --rm dev composer tests
License
MIT licensed, see LICENSE file.