beetle_etl 0.0.19 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dacfd8801cf603b9cec442ee9ea025bc14026234
4
- data.tar.gz: 1a183e975200bb9bdc6e631130903b6ead9739be
3
+ metadata.gz: 0c5a5a3f4d0b4170ccb1581a50a2fccaf32be2cb
4
+ data.tar.gz: c8beb0f668010410cadefe1ae7ab7c7708032acc
5
5
  SHA512:
6
- metadata.gz: bacbe3f6292e52b1ad23d38f5e128b1cf39ec63ded808310a8353956f2b11d349b4ea546012beb22e03edbd3de9bdd787ca0bbde329e1755ebacc23c9561a8ca
7
- data.tar.gz: cbc51b9be8c35b70c21829af0c38f6db0898f4b5c38a2fc6138968bc63591e91f51d7558b2fff62196ba43789b3255f2347c9982d78de33a4d025e3da167084d
6
+ metadata.gz: 3b88ee3cd93eb9344b95bc0b31e01da0a1419d90115fe7a435541b8a336cc3eef8dbad68df819f9993dab3f326be7a91f7b89f8f1e3133b81584834c8f973d65
7
+ data.tar.gz: e696f99dee13095e6ac7ee32a4fc7e0364744bafbc28caca41b8ab5ce87af3c66e832493b116070545401e9e43bbc34d7582f9d004991beac6b994d3a2d2a9f4
data/README.md CHANGED
@@ -2,7 +2,11 @@
2
2
  [![Build Status](https://travis-ci.org/maiwald/beetle_etl.svg?branch=master)](https://travis-ci.org/maiwald/beetle_etl)
3
3
  [![Code Climate](https://codeclimate.com/github/maiwald/beetle_etl.png)](https://codeclimate.com/github/maiwald/beetle_etl)
4
4
 
5
- BeetleETL helps you with synchronising relational databases and recurring imports of data. It is actually quite nice.
5
+ BeetleETL helps you with synchronising relational databases and recurring imports of reference data. It is actually quite nice.
6
+
7
+ Consider you have a set of database tables representing third party data (i.e. the ```source```) and you want to synchronize a set of tables in your application (i.e. the ```target```) with that third party data. Further consider that you want to apply transformations to that ```source``` data before you import it.
8
+
9
+ You define your transformations and BeetleETL will to the rest. Even when your ```source``` data changes, when you run BeetleETL again, it can keep track of what changes need to be applied to what records in your application’s tables.
6
10
 
7
11
  It currently only works with PostgreSQL databases.
8
12
 
@@ -20,21 +24,25 @@ Or install it yourself as:
20
24
 
21
25
  $ gem install beetle_etl
22
26
 
27
+ ## Setup
28
+
29
+ Make sure the tables you want to import contain columns named ```external_id``` and ```external_source``` of type ```CHARACTER VARYING(255)```, as well as timestamp columns named ```created_at```, ```updated_at``` and, ```deleted_at```.
30
+
23
31
  ## Usage
24
32
 
25
33
  ### Configuration
26
34
 
27
35
  BeetleETL.configure do |config|
28
- config.transformation_file = # path to your imports
36
+ config.transformation_file = # path to your transformation file
29
37
  config.database_config = # sequel database config
30
38
  # or config.database = # sequel database instance
31
- config.external_source = ‘source_name
39
+ config.external_source = ‘name_of_your_source
32
40
  config.logger = Logger.new(STDOUT)
33
41
  end
34
42
 
35
43
  ### Defining Imports
36
44
 
37
- Fill a file with all the tables you wish to import and write queries to select the data you want.
45
+ Fill a ```transformation``` file with import directives like this:
38
46
 
39
47
  import :departments do
40
48
  columns :name
@@ -58,6 +66,12 @@ Fill a file with all the tables you wish to import and write queries to select t
58
66
  ON data.org_id = o.id
59
67
  SQL
60
68
  end
69
+
70
+
71
+ ```import``` takes the name of the table you want to fill and the configuration as arguments.
72
+ With ```columns``` you define what columns BeetleETL is supposed to fill in your application’s table.
73
+ The ```query``` transforms the data. Make sure that you insert into ```#{stage_table}``` as the name of the actual table, that this inserts into will be filled in by BeetleETL during runtime.
74
+ Define any foreign references your table has to other tables using the ```refrecences(on:)``` directive. For every foreign key your table has, BeeteETL requires you to fill in a column named ```external_foreign_key``` (prepend "```external_```" to your actual foreign key column).
61
75
 
62
76
 
63
77
  ### Running BeetleETL
@@ -58,7 +58,7 @@ module BeetleETL
58
58
  BeetleETL.logger.fatal(e.message)
59
59
  raise e
60
60
  end
61
- end
61
+ end.abort_on_exception = true
62
62
  end
63
63
 
64
64
  def mark_step_running(step_name)
@@ -1,3 +1,3 @@
1
1
  module BeetleETL
2
- VERSION = "0.0.19"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beetle_etl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luciano Maiwald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-26 00:00:00.000000000 Z
11
+ date: 2015-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel