Recommend this page to a friend! |
Converte CSV para PostgreSql.
composer require the.moiza/csvtopostgresql
Join this project: https://discord.com/channels/973324521987792916/973324521987792918
Support this project: https://skit.network/donate
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
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:
|LatD|LatM|LatS|NS|LonD|LonM|LonS|EW|City |State| |----|----|----|--|----|----|----|--|----------|-----| |41 |5 |59 |N |80 |39 |0 |W |Youngstown|OH | |42 |52 |48 |N |97 |23 |23 |W |Yankton |SD | |46 |35 |59 |N |120 |30 |36 |W |Yakima |WA |
O separador de coluna será detectado automaticamente, pode ser ,(vírgula) ou ;(ponto e vírgula).
A ferramenta tentará detectar os principais tipos de dados:
Help us to translate and write the documentation in other languages.
Classes of Moisés Lima | > | PHP Import CSV to PostgreSQL | > | ![]() |
> | ![]() |
> | ![]() |
> | ![]() ![]() |
|
Groups | ![]() |
Applications | ![]() |
Groups |
![]() |
Database management, accessing and searching | View top rated classes |
![]() |
Data compression and file archive manipulation | View top rated classes |
![]() |
Programming language interpreters and format parsers | View top rated classes |
![]() |
Classes using PHP 7 specific features | View top rated classes |
Innovation Award |
![]() January 2023 Nominee Vote |
PostgreSQL is one of the most popular SQL database server types that many PHP developers use to store and retrieve their applications' data. Sometimes developers need to import data from an external source into the database. This package allows importing data into a PostgreSQL database table from a CSV file that may have been exported from many other types of programs. Manuel Lemos |
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Example | Example script | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Documentation |
![]() |
/ | src |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Example | Example script | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Documentation |
![]() |
/ | src |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|