activewarehouse-etl 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,2 +1,12 @@
1
1
  0.1.0 - Dec 6, 2006
2
- * Initial release
2
+ * Initial release
3
+
4
+ 0.2.0 - Dec 7, 2006
5
+ * Added an XML parser for source parsing
6
+ * Added support for compound key constraints in destinations via the :unique => [] option
7
+ * Added ability to declare explicit columns in bulk import
8
+ * Added support for generators in destinations
9
+ * Added a SurrogateKeyGenerator for cases where the database doesn't support auto generated surrogate keys
10
+
11
+ 0.3.0
12
+ * Added support for calculated values in virtual fields with Proc
@@ -21,7 +21,6 @@ module ETL #:nodoc:
21
21
  @current_row ||= 1
22
22
  end
23
23
 
24
- # Abstract method
25
24
  def write(row)
26
25
  buffer << row
27
26
  flush if buffer.length >= buffer_size
@@ -30,6 +30,7 @@ module ETL #:nodoc:
30
30
 
31
31
  # Flush the destination buffer
32
32
  def flush
33
+ # Engine.logger.debug "Flushing buffer #{buffer}"
33
34
  buffer.each do |row|
34
35
  # check to see if this row's compound key constraint already exists
35
36
  # note that the compound key constraint may not utilize virtual fields
@@ -84,10 +85,13 @@ module ETL #:nodoc:
84
85
  def add_virtuals!(row)
85
86
  if mapping[:virtual]
86
87
  mapping[:virtual].each do |key,value|
88
+ # Engine.logger.debug "Mapping virtual #{key}/#{value} for row #{row}"
87
89
  case value
88
90
  when Symbol
89
91
  generators[key] ||= ETL::Generator::Generator.class_for_name(value).new
90
92
  row[key] = generators[key].next
93
+ when Proc
94
+ row[key] = value.call(row)
91
95
  else
92
96
  row[key] = value
93
97
  end
@@ -1,7 +1,7 @@
1
1
  module ETL
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 2
4
+ MINOR = 3
5
5
  TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: activewarehouse-etl
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2006-12-07 00:00:00 -05:00
6
+ version: 0.3.0
7
+ date: 2006-12-08 00:00:00 -05:00
8
8
  summary: Pure Ruby ETL package.
9
9
  require_paths:
10
10
  - lib