All Projects → dimitri → Pgloader

dimitri / Pgloader

Licence: other
Migrate to PostgreSQL in a single command!

Programming Languages

common lisp
692 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Pgloader

Dbbench
🏋️ dbbench is a simple database benchmarking tool which supports several databases and own scripts
Stars: ✭ 52 (-98.61%)
Mutual labels:  database, mysql, postgresql, sqlite, mssql
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (-41.1%)
Mutual labels:  database, mysql, postgresql, sqlite, mssql
Phpmyfaq
phpMyFAQ - Open Source FAQ web application for PHP and MySQL, PostgreSQL and other databases
Stars: ✭ 494 (-86.84%)
Mutual labels:  database, mysql, postgresql, sqlite, mssql
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+383.96%)
Mutual labels:  database, mysql, postgresql, sqlite, mssql
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-97.04%)
Mutual labels:  database, mysql, postgresql, sqlite, mssql
Evolve
Database migration tool for .NET and .NET Core projects. Inspired by Flyway.
Stars: ✭ 477 (-87.29%)
Mutual labels:  migration, database, mysql, postgresql, sqlite
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+251.36%)
Mutual labels:  database, mysql, postgresql, sqlite, mssql
Dbmigrations
A library for the creation, management, and installation of schema updates for relational databases.
Stars: ✭ 67 (-98.22%)
Mutual labels:  migration, database, mysql, postgresql, sqlite
Nut
Advanced, Powerful and easy to use ORM for Qt
Stars: ✭ 181 (-95.18%)
Mutual labels:  database, mysql, postgresql, sqlite
Endb
Key-value storage for multiple databases. Supports MongoDB, MySQL, Postgres, Redis, and SQLite.
Stars: ✭ 208 (-94.46%)
Mutual labels:  database, mysql, postgresql, sqlite
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (-38.33%)
Mutual labels:  migration, database, mysql, sqlite
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-97.28%)
Mutual labels:  csv, database, mysql, postgresql
Dapper.fsharp
Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL and PostgreSQL
Stars: ✭ 145 (-96.14%)
Mutual labels:  database, mysql, postgresql, mssql
Db
Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
Stars: ✭ 2,832 (-24.56%)
Mutual labels:  database, mysql, postgresql, sqlite
Sql Fundamentals
👨‍🏫 Mike's SQL Fundamentals and Professional SQL Courses
Stars: ✭ 140 (-96.27%)
Mutual labels:  database, mysql, postgresql, sqlite
Mikro Orm
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases.
Stars: ✭ 3,874 (+3.2%)
Mutual labels:  database, mysql, postgresql, sqlite
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-96.62%)
Mutual labels:  database, mysql, postgresql, sqlite
Php Crud Api
Single file PHP script that adds a REST API to a SQL database
Stars: ✭ 2,904 (-22.64%)
Mutual labels:  database, mysql, postgresql, sqlite
Goose
A database migration tool. Supports SQL migrations and Go functions.
Stars: ✭ 2,112 (-43.74%)
Mutual labels:  migration, database, mysql, sqlite
Experdb Db2pg
eXperDB-DB2PG is a data migration solution that transfers data extracted from various DBMSs to eXperDB or PostgreSQL. Currently, Oracle and Oracle Spatial, MySQL, SQL Server(MS-SQL) and Sybase data can be transferred.
Stars: ✭ 24 (-99.36%)
Mutual labels:  migration, mysql, postgresql, mssql

PGLoader

Build Status Join the chat at https://gitter.im/dimitri/pgloader Docker Build Status Read The Docs Status

pgloader is a data loading tool for PostgreSQL, using the COPY command.

Its main advantage over just using COPY or \copy, and over using a Foreign Data Wrapper, is its transaction behaviour, where pgloader will keep a separate file of rejected data, but continue trying to copy good data in your database.

The default PostgreSQL behaviour is transactional, which means that any erroneous line in the input data (file or remote database) will stop the entire bulk load for the table.

pgloader also implements data reformatting, a typical example of that being the transformation of MySQL datestamps 0000-00-00 and 0000-00-00 00:00:00 to PostgreSQL NULL value (because our calendar never had a year zero).

Versioning

pgloader version 1.x is quite old and was developed in TCL. When faced with maintaining that code, the new emerging development team (hi!) picked python instead because that made sense at the time. So pgloader version 2.x was written in python.

The current version of pgloader is the 3.x series, which is written in Common Lisp for better development flexibility, runtime performance, and support of real threading.

The versioning is now following the Emacs model, where any X.0 release number means you're using a development version (alpha, beta, or release candidate). The next stable versions are going to be 3.1 then 3.2 etc.

When using a development snapshot rather than a released version the version number includes the git hash (in its abbreviated form):

  • pgloader version "3.0.99"

    Release candidate 9 for pgloader version 3.1, with a git tag named v3.0.99 so that it's easy to checkout the same sources as the released code.

  • pgloader version "3.0.fecae2c"

    Development snapshot again git hash fecae2c. It's possible to have the same sources on another setup with using the git command git checkout fecae2c.

  • pgloader version "3.1.0"

    Stable release.

LICENCE

pgloader is available under The PostgreSQL Licence.

INSTALL

You can install pgloader directly from apt.postgresql.org and from official debian repositories, see packages.debian.org/pgloader.

$ apt-get install pgloader

You can also use a docker image for pgloader at https://hub.docker.com/r/dimitri/pgloader/:

$ docker pull dimitri/pgloader
$ docker run --rm --name pgloader dimitri/pgloader:latest pgloader --version
$ docker run --rm --name pgloader dimitri/pgloader:latest pgloader --help

Build from sources

pgloader is now a Common Lisp program, tested using the SBCL (>= 1.2.5) and Clozure CL implementations with Quicklisp.

When building from sources, you should always build from the current git HEAD as it's basically the only source that is managed in a way to ensure it builds aginst current set of dependencies versions.

Building from sources on debian

$ apt-get install sbcl unzip libsqlite3-dev make curl gawk freetds-dev libzip-dev
$ cd /path/to/pgloader
$ make pgloader
$ ./build/bin/pgloader --help

Building from sources on RedHat/CentOS

See "Redhat / CentOS" in INSTALL.md

Building from sources on macOS

When using brew, it should be a simple brew install --HEAD pgloader.

When using macports, then we have a situation to deal with with shared objects pgloader depends on, as reported in issue #161 at https://github.com/dimitri/pgloader/issues/161#issuecomment-201162647:

I was able to get a clean build without having to disable compression after symlinking /usr/local/lib to /opt/local/lib. Note that I did not have anything installed to /usr/local/lib so I didn't lose anything here.

Building from sources on Windows

Building pgloader on Windows is supported, thanks to Common Lisp implementations being available on that platform, and to the Common Lisp Standard for making it easy to write actually portable code.

It is recommended to have a look at the issues labelled with Windows support if you run into trouble when building pgloader:

https://github.com/dimitri/pgloader/issues?utf8=✓&q=label%3A%22Windows%20support%22%20

Building Docker image from sources

You can build a Docker image from source using SBCL by default:

$ docker build .

Or Clozure CL (CCL):

$ docker build -f Dockerfile.ccl .

More options when building from source

The Makefile target pgloader knows how to produce a Self Contained Binary file for pgloader, found at ./build/bin/pgloader:

$ make pgloader

By default, the Makefile uses SBCL to compile your binary image, though it's possible to build using CCL.

$ make CL=ccl pgloader

If using SBCL and it supports core compression, the make process will use it to generate a smaller binary. To force disabling core compression, you may use:

$ make COMPRESS_CORE=no pgloader

The --compress-core is unique to SBCL, so not used when CC is different from the sbcl value.

You can also tweak the default amount of memory that the pgloader image will allow itself using when running through your data (don't ask for more than your current RAM tho):

$ make DYNSIZE=8192 pgloader

The make pgloader command when successful outputs a ./build/bin/pgloader file for you to use.

Usage

You can either give a command file to pgloader or run it all from the command line, see the pgloader quick start on https://pgloader.readthedocs.io for more details.

$ ./build/bin/pgloader --help
$ ./build/bin/pgloader <file.load>

For example, for a full migration from SQLite:

$ createdb newdb
$ pgloader ./test/sqlite/sqlite.db postgresql:///newdb

Or for a full migration from MySQL, including schema definition (tables, indexes, foreign keys, comments) and parallel loading of the corrected data:

$ createdb pagila
$ pgloader mysql://user@localhost/sakila postgresql:///pagila
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].