PHPackages                             the.moiza/csvtopostgresql - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. the.moiza/csvtopostgresql

ActiveLibrary[File &amp; Storage](/categories/file-storage)

the.moiza/csvtopostgresql
=========================

Convert CSV to PostgreSql

v1.0.23.4(3y ago)16MITPHPPHP &gt;=7.2CI passing

Since Jan 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/themoiza/csvtopostgresql)[ Packagist](https://packagist.org/packages/the.moiza/csvtopostgresql)[ RSS](/packages/themoiza-csvtopostgresql/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

Csv to PostgreSql with PHP
==========================

[](#csv-to-postgresql-with-php)

Converte CSV para PostgreSql.

[![PHP Composer](https://github.com/themoiza/csvtopostgresql/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/themoiza/csvtopostgresql/actions/workflows/php.yml) [![Total Downloads](https://camo.githubusercontent.com/ee0c1aead628f12c2129da0442082faab30204a1cd583ed8e8bf76f50870ebf0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468652e6d6f697a612f637376746f706f737467726573716c)](https://packagist.org/packages/the.moiza/csvtopostgresql) [![Latest Stable Version](https://camo.githubusercontent.com/589a7e168a0e4472e1bdd0929e076c4276d0e2a9a12fb6875e6b9f4f6ab7e50d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7468652e6d6f697a612f637376746f706f737467726573716c)](https://packagist.org/packages/the.moiza/csvtopostgresql) [![License](https://camo.githubusercontent.com/a93c2b51bafcd7cc083ad4ee80f73e95cfd19e0905c37a546b5675de26cb84f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7468652e6d6f697a612f637376746f706f737467726573716c)](https://packagist.org/packages/the.moiza/csvtopostgresql)

Install with composer
---------------------

[](#install-with-composer)

```
composer require the.moiza/csvtopostgresql

```

CONTRIBUTE
----------

[](#contribute)

Join this project:

Support this project:

UNIT TEST
---------

[](#unit-test)

```
composer test

```

PT-BR
-----

[](#pt-br)

Dependências da ferramenta: **php7.2 ou maior**, **mbstring**, **fileinfo**, **zip** e **pdo**;

Você poder usar o modo CLI para fazer a conversão, ou criar sua própria implementação.

```
php cli.php

```

### CONFIGURAÇÕES

[](#configurações)

- **createPkey** = Se true, cria crave primária **\_pkey\_**, padrão: **false**;
- **enableTrim** = Se true, corta espaços em branco, quebra de linha tab no início e fim de cada dado importado, padrão: **true**;
- **enableTransaction** = Se true habilita boa prática de Transaction (recomendado), padrão: **true**;
- **justCreateTables** = Se true, não insere os dados, apenas cria as tabelas, padrão: **false**;
- **inputEncoding** = Seta encoding do CSV, padrão: UTF-8';
- **outputEncoding** = Seta encoding do banco de dados, padrão: UTF-8';

### O CSV

[](#o-csv)

O CSV deve estar em formato ZIP.

O(s) CSV(s) devem ter na primeira linha os nomes das colunas. Cada CSV será importado como uma tabela.

O nome da tabela será o nome do arquivo CSV corretamente tratado com lowcase, remoção de acentos, substituição de espaços ( ) e hífen (-) por (\_) underline;

Os nomes das colunas serão tratados com as mesmas regras.

Binários (blob, bytea) devem ser exportados em BASE64 para o CSV e serão importados como **text**.

Exemplo de CSV aceito:

LatDLatMLatSNSLonDLonMLonSEWCityState41559N80390WYoungstownOH425248N972323WYanktonSD463559N1203036WYakimaWAO separador de coluna será detectado automaticamente, pode ser ,(vírgula) ou ;(ponto e vírgula).

A ferramenta tentará detectar os principais tipos de dados:

- timestamp
- date
- numeric
- integer
- boolean
- text

EN
--

[](#en)

Help us to translate and write the documentation in other languages.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance58

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

6

Last Release

1211d ago

Major Versions

v0.9.3-beta → v1.02023-01-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/197253536b62574e12368c6c617ad6e1012c201ee0c51bbdf5c6df4f9dfb13fc?d=identicon)[the.moiza](/maintainers/the.moiza)

---

Top Contributors

[![moisesaraldi](https://avatars.githubusercontent.com/u/32937203?v=4)](https://github.com/moisesaraldi "moisesaraldi (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/themoiza-csvtopostgresql/health.svg)

```
[![Health](https://phpackages.com/badges/themoiza-csvtopostgresql/health.svg)](https://phpackages.com/packages/themoiza-csvtopostgresql)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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