keboola / db-writer-adapter
MyComponent description
0.1.0
2024-02-09 20:17 UTC
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
Connection
is an abstraction that represents a connection to the database.- Abstract class
BaseConnection
contains common code and retry mechanisms. - Class
PdoConnection
implements connection using PDO extension. - Class
OdbcConnection
implements connection using ODBC extension.
- Abstract class
- Interface
WriteAdapter
is an abstraction which defines how the data is written.- Abstract class
BaseWriteAdapter
contains common code. - Class
PdoWriteAdapter
implements write for PDO connection. - Class
OdbcWriteAdapter
implements write for ODBC connection.
- Abstract class
- Interface
QueryBuilder
used to generate SQL query for adapter.- Class
DefaultQueryFactory
is 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.