squealer 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +24 -4
  2. data/VERSION +1 -1
  3. data/squealer.gemspec +2 -2
  4. metadata +3 -3
data/README.md CHANGED
@@ -1,13 +1,33 @@
1
1
  # Squealer
2
2
 
3
+ ## Warning
4
+ Squealer is for standalone operation. Do not use it from within your application. To make the DSL easy to use, we alter `Object`, `NilClass`, `Time`, and `Hash`.
5
+
6
+ * `Object` - `#import`, `#export`, `#target`, and `#assign` "keywords" are provided for convenience
7
+ * `NilClass`
8
+ * `#each` - As you are importing from schemaless repositories and you may be trying to iterate on fields that contain embedded collections, if a specific parent does not contain one of those child collections, the driver will be returning "nil" as the value for that field. Having `NilClass#each` return a `[]` for a nil is convenient, semantically correct in this context, and removes the need for many nil checks in the block you provide to `Object#assign`
9
+ * `Time`
10
+ * `#to_s` - As you are exporting to a SQL database, we represent your timestamp in a format that it will parse unequivocally (mongodb stores all temporal data as a timestamp)
11
+ * `Hash`
12
+ * `#method_missing` - You prefer dot notation. JSON uses dot notation. You are importing from a data store which represents collections as arrays of hashmaps. Dot notation for navigating those collections is convenient. If you use a field name that happens to be a method on Hash you will have to use index notation. (e.g. `kitten.toys` is good, however `kitten.freeze` is not good. Use `kitten['freeze']` instead.)
13
+
14
+ To run standalone, simply make your data squeal thusly:
15
+
16
+ `> ruby example_squeal.rb`
17
+
18
+ where the squeal script requires 'squealer'.
19
+
20
+ Squealer doesn't use your application classes. It doesn't use your ActiveRecord models. It's an ETL tool. It could even be called a HRM (Hashmap-Relational-Mapper), but only in hushed tones in the corner boothes of dark pubs.
21
+
22
+ ## Databases supported
3
23
  For now, this is specifically for MongoDB exporting to mySQL with the assumption that the data will be heavily denormalized.
4
24
 
5
- The target SQL database must have no foreign keys.
25
+ ## Notes
26
+ The target SQL database must have no foreign keys (because it can't rely on the primary key values and referential integrity is the responsibility of the source data store or the application that uses it).
6
27
 
7
28
  The target SQL database must use a primary key of char(16) with value of the MongoDB id.
8
29
 
9
- It is assumed no indexes are present in the target database table.
10
-
11
- The target row is inserted, or updated if present. We are using MySQL INSERT ... UPDATE ON DUPLICATE KEY extended syntax to achieve this for now. This allows an event-driven update of exported data as well as a bulk batch process.
30
+ It is assumed no indexes are present in the target database table (performance drag). You may want to create indexes for pulling data out of the database Squealer exports to. You should drop them again when you've done the pull.
12
31
 
32
+ The target row is inserted, or updated if present. We are using MySQL `INSERT ... UPDATE ON DUPLICATE KEY` extended syntax to achieve this for now. This allows an event-driven update of exported data as well as a bulk batch process.
13
33
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/squealer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{squealer}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Graham", "Durran Jordan"]
12
- s.date = %q{2010-03-23}
12
+ s.date = %q{2010-03-26}
13
13
  s.description = %q{Exports mongodb to mysql. More later.}
14
14
  s.email = %q{joshua.graham@grahamis.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 0
9
- version: 1.0.0
8
+ - 1
9
+ version: 1.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Josh Graham
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-03-23 00:00:00 -05:00
18
+ date: 2010-03-26 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency