PHPackages                             keboola/php-csv-db-import - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. keboola/php-csv-db-import

ActiveLibrary[Database &amp; ORM](/categories/database)

keboola/php-csv-db-import
=========================

Handling of large bulk data into database tables.

6.1.1(11mo ago)458.8k↑42.9%[6 issues](https://github.com/keboola/php-db-import/issues)[4 PRs](https://github.com/keboola/php-db-import/pulls)1MITPHPPHP ^7.4|^8CI passing

Since Jan 8Pushed 6mo ago14 watchersCompare

[ Source](https://github.com/keboola/php-db-import)[ Packagist](https://packagist.org/packages/keboola/php-csv-db-import)[ RSS](/packages/keboola-php-csv-db-import/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (83)Used By (1)

Keboola Database table importer
===============================

[](#keboola-database-table-importer)

[![Build Status](https://camo.githubusercontent.com/aaae89d953961ecd96c645dc22afd44214de4cfcc2dd8ffb61bc0a790cfcd537/68747470733a2f2f7472617669732d63692e6f72672f6b65626f6f6c612f7068702d64622d696d706f72742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/keboola/php-db-import)

Handling of large bulk data into database tables.

### Supported engines:

[](#supported-engines)

- `AWS Redshift`, `Snowflake`
    - Load data from CSV stored in AWS S3
    - Load data from another Redshift table in same database

### Features

[](#features)

- Full load - destination table is truncated before load
- Incremental load - data are merged
- Primary key dedup for all engines
- Convert empty values to `NULL` (using `convertEmptyValuesToNull` option)

### Development

[](#development)

#### Preparation

[](#preparation)

- Create AWS S3 bucket and IAM user using `aws-services.json` cloudformation template.
- Create Redshift cluster
- Download Snowflake driver (.deb) and place it into root of repository (`./snowflake-odbc.deb`)
- Create `.env` file. Use output of `aws-services` cloudfront stack to fill the variables and your Redshift credentials.

```
REDSHIFT_HOST=
REDSHIFT_PORT=5439
REDSHIFT_USER=
REDSHIFT_DATABASE=
REDSHIFT_PASSWORD=

SNOWFLAKE_HOST=
SNOWFLAKE_PORT=
SNOWFLAKE_USER=
SNOWFLAKE_PASSWORD=
SNOWFLAKE_DATABASE=
SNOWFLAKE_WAREHOUSE=

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET=
AWS_REGION=

```

Upload test fixtures to S3:

```
docker compose run php php ./tests/loadS3.php

```

### Redshift settings

[](#redshift-settings)

User and database are required for tests. You can create them:

```
CREATE USER keboola_db_import PASSWORD 'YOUR_PASSWORD';
CREATE DATABASE keboola_db_import;
GRANT ALL ON DATABASE keboola_db_import TO keboola_db_import;

```

#### Snowflake settings

[](#snowflake-settings)

Role, user, database and warehouse are required for tests. You can create them:

```
CREATE ROLE "KEBOOLA_DB_IMPORT";
CREATE DATABASE "KEBOOLA_DB_IMPORT";
GRANT ALL PRIVILEGES ON DATABASE "KEBOOLA_DB_IMPORT" TO ROLE "KEBOOLA_DB_IMPORT";

CREATE WAREHOUSE "KEBOOLA_DB_IMPORT" WITH WAREHOUSE_SIZE = 'XSMALL' WAREHOUSE_TYPE = 'STANDARD' AUTO_SUSPEND = 3600 AUTO_RESUME = TRUE;
GRANT USAGE ON WAREHOUSE "KEBOOLA_DB_IMPORT" TO ROLE "KEBOOLA_DB_IMPORT" WITH GRANT OPTION;

CREATE USER "KEBOOLA_DB_IMPORT"
PASSWORD = "YOUR_PASSWORD"
DEFAULT_ROLE = "KEBOOLA_DB_IMPORT";

GRANT ROLE "KEBOOLA_DB_IMPORT" TO USER "KEBOOLA_DB_IMPORT";

```

#### Tests Execution

[](#tests-execution)

Run tests with following command.

```
docker compose run --rm tests

```

Redshift and S3 credentials have to be provided.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance40

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 61.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~253 days

Total

58

Last Release

357d ago

Major Versions

1.5.1 → 2.0.02016-08-15

2.4.4 → 3.0.02017-07-12

3.0.1 → 4.0.02018-04-27

4.1.2 → 5.0.02019-09-04

5.3.0 → 6.0.02023-02-03

PHP version history (2 changes)4.0.0PHP ^7.1

6.0.0PHP ^7.4|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/101dbf2551a0709ddab522f97669f13a2c4cc2d0a1e8d009f3af6ba80accb1a9?d=identicon)[Keboola](/maintainers/Keboola)

---

Top Contributors

[![Halama](https://avatars.githubusercontent.com/u/903531?v=4)](https://github.com/Halama "Halama (217 commits)")[![pivnicek](https://avatars.githubusercontent.com/u/569139?v=4)](https://github.com/pivnicek "pivnicek (27 commits)")[![zajca](https://avatars.githubusercontent.com/u/180148?v=4)](https://github.com/zajca "zajca (24 commits)")[![yustme](https://avatars.githubusercontent.com/u/5272798?v=4)](https://github.com/yustme "yustme (19 commits)")[![ErikZigo](https://avatars.githubusercontent.com/u/1726727?v=4)](https://github.com/ErikZigo "ErikZigo (17 commits)")[![ondrejhlavacek](https://avatars.githubusercontent.com/u/497675?v=4)](https://github.com/ondrejhlavacek "ondrejhlavacek (16 commits)")[![themark147](https://avatars.githubusercontent.com/u/17779619?v=4)](https://github.com/themark147 "themark147 (10 commits)")[![tomasfejfar](https://avatars.githubusercontent.com/u/642928?v=4)](https://github.com/tomasfejfar "tomasfejfar (7 commits)")[![romanbracinik](https://avatars.githubusercontent.com/u/6448364?v=4)](https://github.com/romanbracinik "romanbracinik (6 commits)")[![ujovlado](https://avatars.githubusercontent.com/u/419849?v=4)](https://github.com/ujovlado "ujovlado (6 commits)")[![martinjunger](https://avatars.githubusercontent.com/u/84506613?v=4)](https://github.com/martinjunger "martinjunger (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/keboola-php-csv-db-import/health.svg)

```
[![Health](https://phpackages.com/badges/keboola-php-csv-db-import/health.svg)](https://phpackages.com/packages/keboola-php-csv-db-import)
```

###  Alternatives

[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)[flow-php/doctrine-dbal-bulk

Bulk inserts and updates for Doctrine DBAL

14295.2k1](/packages/flow-php-doctrine-dbal-bulk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
