All Projects → hooopo → Kiba Plus

hooopo / Kiba Plus

Licence: other
Kiba enhancement for Ruby ETL.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Kiba Plus

Transformalize
Configurable Extract, Transform, and Load
Stars: ✭ 125 (+165.96%)
Mutual labels:  etl, mysql, postgresql
Luigi Warehouse
A luigi powered analytics / warehouse stack
Stars: ✭ 72 (+53.19%)
Mutual labels:  etl, mysql, postgresql
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+4604.26%)
Mutual labels:  etl, mysql, postgresql
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (+117.02%)
Mutual labels:  etl, mysql, postgresql
Storagetapper
StorageTapper is a scalable realtime MySQL change data streaming, logical backup and logical replication service
Stars: ✭ 232 (+393.62%)
Mutual labels:  etl, mysql, postgresql
Treefrog Framework
TreeFrog Framework : High-speed C++ MVC Framework for Web Application
Stars: ✭ 885 (+1782.98%)
Mutual labels:  mysql, postgresql
Eosio sql plugin
EOSIO sql database plugin
Stars: ✭ 21 (-55.32%)
Mutual labels:  mysql, postgresql
Wait4x
Wait4X is a cli tool to wait for everything! It can be wait for a port to open or enter to rquested state.
Stars: ✭ 30 (-36.17%)
Mutual labels:  mysql, postgresql
Notes
📝 Migrated to(迁移至) https://github.com/Kuangcp/Note 当前仓库已经废弃, 对应的博客网站:
Stars: ✭ 33 (-29.79%)
Mutual labels:  mysql, postgresql
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 (-48.94%)
Mutual labels:  mysql, postgresql
Lealone Plugins
与 Lealone 集成的各类插件(例如网络框架以及不同的数据库协议和存储引擎)
Stars: ✭ 31 (-34.04%)
Mutual labels:  mysql, postgresql
Pyetl
python ETL framework
Stars: ✭ 33 (-29.79%)
Mutual labels:  etl, mysql
Monogamy
Add table-level database locking to ActiveRecord
Stars: ✭ 12 (-74.47%)
Mutual labels:  mysql, postgresql
Netkiller.github.io
Netkiller Free ebook - 免费电子书
Stars: ✭ 861 (+1731.91%)
Mutual labels:  mysql, postgresql
Tbls
tbls is a CI-Friendly tool for document a database, written in Go.
Stars: ✭ 940 (+1900%)
Mutual labels:  mysql, postgresql
Ridgepole
Ridgepole is a tool to manage DB schema. It defines DB schema using Rails DSL, and updates DB schema according to DSL. (like Chef/Puppet)
Stars: ✭ 840 (+1687.23%)
Mutual labels:  mysql, postgresql
Soci
Official repository of the SOCI - The C++ Database Access Library
Stars: ✭ 960 (+1942.55%)
Mutual labels:  mysql, postgresql
Iobroker.sql
Store history data in SQL Database: MySQL, PostgreSQL or SQLite
Stars: ✭ 37 (-21.28%)
Mutual labels:  mysql, postgresql
Goqu
SQL builder and query library for golang
Stars: ✭ 984 (+1993.62%)
Mutual labels:  mysql, postgresql
Phalcon Vm
Vagrant configuration for PHP7, Phalcon 3.x and Zephir development.
Stars: ✭ 43 (-8.51%)
Mutual labels:  mysql, postgresql

kiba-plus

Kiba enhancement for Ruby ETL. It connects to various data sources including relational, non-relational, and flat file, cloud services and HTTP resources. It has flexible load strategies including insert, bulk load and upsert.

Usage

# /tmp/customer_mysql_to_pg.etl

require 'kiba/plus'

require 'kiba/plus/source/mysql'
require 'kiba/plus/destination/pg_bulk2'

SOURCE_URL = 'mysql://[email protected]/shopperplus'

DEST_URL   = 'postgresql://[email protected]:5432/crm2_dev'

source Kiba::Plus::Source::Mysql, { :connect_url => SOURCE_URL,
                           :query => %Q{SELECT id, email, 'hooopo' AS first_name, 'Wang' AS last_name FROM customers}
                         }

destination Kiba::Plus::Destination::PgBulk2, { :connect_url => DEST_URL,
                                :table_name => "customers",
                                :truncate => true,
                                :columns => [:id, :email, :first_name, :last_name],
                                :incremental => false
                              }

post_process do
  result = PG.connect(DEST_URL).query("SELECT COUNT(*) AS num FROM customers")
  puts "Insert total: #{result.first['num']}"
end

Execute in shell:

$ bundle exec kiba /tmp/customer_mysql_to_pg.etl

# Output:
# I, [2016-05-16T01:53:36.832565 #87909]  INFO -- : TRUNCATE TABLE customers;
# I, [2016-05-16T01:53:36.841770 #87909]  INFO -- : COPY customers (id, email, first_name, last_name) FROM STDIN WITH DELIMITER ',' NULL '\N' CSV
# Insert total: 428972

Execute in ruby script:

require 'kiba'

job_definition = Kiba.parse(IO.read('/tmp/customer_mysql_to_pg.etl'), '/tmp/customer_mysql_to_pg.etl')
Kiba.run(job_definition)

Examples

Main Feature

  • Csv Source

  • MySQL Source

  • Postgresql Source

  • Citus Source

  • Greenplus Source

  • MongoDB Source (TODO)

  • Elastic Source (TODO)

  • Redshift Source (TODO)

  • Csv Destination

  • MySQL Destination

  • Postgresql Destination

  • Citus Destination

  • Greenplus Destination

  • MongoDB Destination (TODO)

  • Elastic Destination (TODO)

  • Redshift Destination (TODO)

  • Bulk Load for large dataset

  • Upsert for MySQL & Postgresql

  • Incremental Update

Installation

Add this line to your application's Gemfile:

gem 'kiba'
gem 'kiba-plus'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kiba-plus

Development

First of all, Please run the following code in shell.

$ mysql -e 'create database kiba_plus_src_test;'

$ mysql -e 'create database kiba_plus_dest_test;'

$ psql -c 'create database kiba_plus_src_test;' -U postgres

$ psql -c 'create database kiba_plus_dest_test;' -U postgres

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hooopo/kiba-plus.

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].