sequel_load_data_infile 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -101,7 +101,7 @@ module Sequel
101
101
 
102
102
  def binary_columns
103
103
  @binary_columns ||= @db.schema(@table).
104
- select {|a| a[1][:type] == :blob }.map {|a| a.first.to_s }
104
+ select {|a| a[1][:db_type] =~ /^binary/ }.map {|a| a.first.to_s }
105
105
  end
106
106
 
107
107
  def set_columns
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sequel_load_data_infile"
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roland Swingler"]
12
- s.date = "2013-06-05"
12
+ s.date = "2013-09-09"
13
13
  s.description = "Provides LOAD DATA INFILE support for mysql datasets"
14
14
  s.email = "roland.swingler@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.homepage = "http://github.com/knaveofdiamonds/sequel_load_data_infile"
35
35
  s.licenses = ["MIT"]
36
36
  s.require_paths = ["lib"]
37
- s.rubygems_version = "1.8.24"
37
+ s.rubygems_version = "1.8.25"
38
38
  s.summary = "Provides LOAD DATA INFILE support for mysql datasets"
39
39
 
40
40
  if s.respond_to? :specification_version then
@@ -63,9 +63,16 @@ describe Sequel::LoadDataInfileExpression do
63
63
  end
64
64
 
65
65
  it "unhexes binary columns automatically via set" do
66
- TEST_DB.stub(:schema).and_return([[:bar, {:type => :blob}]])
66
+ TEST_DB.stub(:schema).and_return([[:bar, {:type => :blob, :db_type => "binary(16)"}]])
67
67
  sql = described_class.new("bar.csv", :foo, [:bar, :quux]).to_sql(TEST_DB)
68
68
  sql.should include("(@bar,`quux`)")
69
69
  sql.should include("SET `bar` = unhex(@bar)")
70
70
  end
71
+
72
+ it "doesn't trust Sequel's type conversion" do
73
+ TEST_DB.stub(:schema).and_return([[:bar, {:type => :blob, :db_type => "enum('foo')"}]])
74
+ sql = described_class.new("bar.csv", :foo, [:bar, :quux]).to_sql(TEST_DB)
75
+ sql.should_not include("(@bar,`quux`)")
76
+ sql.should_not include("SET `bar` = unhex(@bar)")
77
+ end
71
78
  end
metadata CHANGED
@@ -1,104 +1,106 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sequel_load_data_infile
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 3
10
+ version: 0.0.3
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Roland Swingler
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2013-06-05 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: sequel
16
- requirement: !ruby/object:Gem::Requirement
17
+
18
+ date: 2013-09-09 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
17
22
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ hash: 3
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ requirement: *id001
22
31
  type: :runtime
23
32
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: mysql
32
- requirement: !ruby/object:Gem::Requirement
33
+ name: sequel
34
+ - !ruby/object:Gem::Dependency
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
33
36
  none: false
34
- requirements:
35
- - - '='
36
- - !ruby/object:Gem::Version
37
+ requirements:
38
+ - - "="
39
+ - !ruby/object:Gem::Version
40
+ hash: 45
41
+ segments:
42
+ - 2
43
+ - 8
44
+ - 1
37
45
  version: 2.8.1
46
+ requirement: *id002
38
47
  type: :development
39
48
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - '='
44
- - !ruby/object:Gem::Version
45
- version: 2.8.1
46
- - !ruby/object:Gem::Dependency
47
- name: rspec
48
- requirement: !ruby/object:Gem::Requirement
49
+ name: mysql
50
+ - !ruby/object:Gem::Dependency
51
+ version_requirements: &id003 !ruby/object:Gem::Requirement
49
52
  none: false
50
- requirements:
53
+ requirements:
51
54
  - - ~>
52
- - !ruby/object:Gem::Version
53
- version: '2'
55
+ - !ruby/object:Gem::Version
56
+ hash: 7
57
+ segments:
58
+ - 2
59
+ version: "2"
60
+ requirement: *id003
54
61
  type: :development
55
62
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '2'
62
- - !ruby/object:Gem::Dependency
63
- name: bundler
64
- requirement: !ruby/object:Gem::Requirement
63
+ name: rspec
64
+ - !ruby/object:Gem::Dependency
65
+ version_requirements: &id004 !ruby/object:Gem::Requirement
65
66
  none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ requirement: *id004
70
75
  type: :development
71
76
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- - !ruby/object:Gem::Dependency
79
- name: jeweler
80
- requirement: !ruby/object:Gem::Requirement
77
+ name: bundler
78
+ - !ruby/object:Gem::Dependency
79
+ version_requirements: &id005 !ruby/object:Gem::Requirement
81
80
  none: false
82
- requirements:
81
+ requirements:
83
82
  - - ~>
84
- - !ruby/object:Gem::Version
83
+ - !ruby/object:Gem::Version
84
+ hash: 63
85
+ segments:
86
+ - 1
87
+ - 8
88
+ - 4
85
89
  version: 1.8.4
90
+ requirement: *id005
86
91
  type: :development
87
92
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ~>
92
- - !ruby/object:Gem::Version
93
- version: 1.8.4
93
+ name: jeweler
94
94
  description: Provides LOAD DATA INFILE support for mysql datasets
95
95
  email: roland.swingler@gmail.com
96
96
  executables: []
97
+
97
98
  extensions: []
98
- extra_rdoc_files:
99
+
100
+ extra_rdoc_files:
99
101
  - LICENSE.txt
100
102
  - README.rdoc
101
- files:
103
+ files:
102
104
  - .document
103
105
  - .rspec
104
106
  - Gemfile
@@ -113,31 +115,37 @@ files:
113
115
  - spec/load_data_infile_spec.rb
114
116
  - spec/spec_helper.rb
115
117
  homepage: http://github.com/knaveofdiamonds/sequel_load_data_infile
116
- licenses:
118
+ licenses:
117
119
  - MIT
118
120
  post_install_message:
119
121
  rdoc_options: []
120
- require_paths:
122
+
123
+ require_paths:
121
124
  - lib
122
- required_ruby_version: !ruby/object:Gem::Requirement
125
+ required_ruby_version: !ruby/object:Gem::Requirement
123
126
  none: false
124
- requirements:
125
- - - ! '>='
126
- - !ruby/object:Gem::Version
127
- version: '0'
128
- segments:
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ hash: 3
131
+ segments:
129
132
  - 0
130
- hash: 2675046782985477919
131
- required_rubygems_version: !ruby/object:Gem::Requirement
133
+ version: "0"
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
135
  none: false
133
- requirements:
134
- - - ! '>='
135
- - !ruby/object:Gem::Version
136
- version: '0'
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ hash: 3
140
+ segments:
141
+ - 0
142
+ version: "0"
137
143
  requirements: []
144
+
138
145
  rubyforge_project:
139
- rubygems_version: 1.8.24
146
+ rubygems_version: 1.8.25
140
147
  signing_key:
141
148
  specification_version: 3
142
149
  summary: Provides LOAD DATA INFILE support for mysql datasets
143
150
  test_files: []
151
+