keboola/db-extractor-adapter
最新稳定版本:1.15.2
Composer 安装命令:
composer require keboola/db-extractor-adapter
包简介
Set of connection adapters for DB extractors.
README 文档
README
This library contains a common interface for connecting to and data extracting from, various sources:
- It is intended for use with db-extractor-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
DbConnectionis an abstraction that represents a connection to the database.- Abstract class
BaseDbConnectioncontains common code and retry mechanisms. - Class
PdoDbConnectionimplements connection using PDO extension. - Class
OdbcDbConnectionimplements connection using ODBC extension.
- Abstract class
- Interface
QueryResultis an abstraction that represents query result - rows returned from database.- Class
PdoQueryResultrepresents result from PDO connection. - Class
OdbcQueryResultrepresents result from ODBC connection.
- Class
- Interface
ExportAdapteris an abstraction which defines how the data is to be extracted.- Based on
ExportConfig,ExportResultis generated. The rows are written to the specified CSV file. - By implementing this interface, it is possible to add support for CLI tools for export.
- Abstract class
BaseExportAdaptercontains common code. - Class
PdoExportAdapterimplements export for PDO connection. - Class
OdbcExportAdapterimplements export for ODBC connection. - Class
FallbackExportAdapterallows you to use multiple adapters. If one fails, then fallback adapter is used.
- Based on
- Interface
QueryFactoryused to generate SQL query fromExportConfig. It is used if query is not set in the config.- Class
DefaultQueryFactoryis base implementation for MySQL/MariaDb compatible SQL dialects.
- Class
- Class
QueryResultCsvWriterused to write rows from theQueryResultto the specified CSV file.
Development
Clone this repository and init the workspace with following command:
git clone https://github.com/keboola/db-extractor-adapter
cd db-extractor-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.
统计信息
- 总下载量: 3.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-12