rom-sql 2.0.0.beta2 → 2.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +66 -0
  3. data/lib/rom/plugins/relation/sql/postgres/explain.rb +54 -0
  4. data/lib/rom/sql.rb +1 -1
  5. data/lib/rom/sql/attribute.rb +17 -18
  6. data/lib/rom/sql/errors.rb +3 -0
  7. data/lib/rom/sql/extensions/mysql.rb +1 -1
  8. data/lib/rom/sql/extensions/mysql/type_builder.rb +28 -0
  9. data/lib/rom/sql/extensions/postgres.rb +3 -1
  10. data/lib/rom/sql/extensions/postgres/commands.rb +30 -13
  11. data/lib/rom/sql/extensions/postgres/{attributes_inferrer.rb → type_builder.rb} +24 -28
  12. data/lib/rom/sql/extensions/postgres/type_serializer.rb +39 -0
  13. data/lib/rom/sql/extensions/postgres/types.rb +24 -477
  14. data/lib/rom/sql/extensions/postgres/types/array.rb +163 -0
  15. data/lib/rom/sql/extensions/postgres/types/geometric.rb +135 -0
  16. data/lib/rom/sql/extensions/postgres/types/json.rb +235 -0
  17. data/lib/rom/sql/extensions/postgres/types/network.rb +15 -0
  18. data/lib/rom/sql/extensions/sqlite.rb +1 -1
  19. data/lib/rom/sql/extensions/sqlite/{attributes_inferrer.rb → type_builder.rb} +5 -5
  20. data/lib/rom/sql/extensions/sqlite/types.rb +8 -3
  21. data/lib/rom/sql/foreign_key.rb +17 -0
  22. data/lib/rom/sql/function.rb +86 -8
  23. data/lib/rom/sql/gateway.rb +26 -26
  24. data/lib/rom/sql/index.rb +4 -0
  25. data/lib/rom/sql/migration.rb +3 -3
  26. data/lib/rom/sql/migration/inline_runner.rb +9 -83
  27. data/lib/rom/sql/migration/migrator.rb +35 -12
  28. data/lib/rom/sql/migration/recorder.rb +21 -0
  29. data/lib/rom/sql/migration/runner.rb +115 -0
  30. data/lib/rom/sql/migration/schema_diff.rb +108 -53
  31. data/lib/rom/sql/migration/writer.rb +61 -0
  32. data/lib/rom/sql/relation.rb +2 -1
  33. data/lib/rom/sql/relation/reading.rb +63 -3
  34. data/lib/rom/sql/relation/writing.rb +38 -0
  35. data/lib/rom/sql/schema.rb +9 -3
  36. data/lib/rom/sql/schema/attributes_inferrer.rb +3 -119
  37. data/lib/rom/sql/schema/inferrer.rb +99 -18
  38. data/lib/rom/sql/schema/type_builder.rb +94 -0
  39. data/lib/rom/sql/type_dsl.rb +30 -0
  40. data/lib/rom/sql/type_extensions.rb +11 -6
  41. data/lib/rom/sql/type_serializer.rb +46 -0
  42. data/lib/rom/sql/types.rb +12 -0
  43. data/lib/rom/sql/version.rb +1 -1
  44. metadata +26 -244
  45. data/.codeclimate.yml +0 -15
  46. data/.gitignore +0 -17
  47. data/.rspec +0 -3
  48. data/.travis.yml +0 -39
  49. data/.yardopts +0 -2
  50. data/Gemfile +0 -33
  51. data/Guardfile +0 -24
  52. data/LICENSE.txt +0 -22
  53. data/Rakefile +0 -19
  54. data/circle.yml +0 -10
  55. data/lib/rom/sql/extensions/mysql/attributes_inferrer.rb +0 -10
  56. data/lib/rom/sql/relation/sequel_api.rb +0 -133
  57. data/log/.gitkeep +0 -0
  58. data/rom-sql.gemspec +0 -29
  59. data/spec/extensions/postgres/attribute_spec.rb +0 -217
  60. data/spec/extensions/postgres/integration_spec.rb +0 -59
  61. data/spec/extensions/postgres/types_spec.rb +0 -252
  62. data/spec/extensions/sqlite/types_spec.rb +0 -11
  63. data/spec/fixtures/migrations/20150403090603_create_carrots.rb +0 -8
  64. data/spec/integration/associations/many_to_many/custom_fks_spec.rb +0 -76
  65. data/spec/integration/associations/many_to_many/from_view_spec.rb +0 -88
  66. data/spec/integration/associations/many_to_many_spec.rb +0 -162
  67. data/spec/integration/associations/many_to_one/custom_fks_spec.rb +0 -64
  68. data/spec/integration/associations/many_to_one/from_view_spec.rb +0 -84
  69. data/spec/integration/associations/many_to_one/self_ref_spec.rb +0 -53
  70. data/spec/integration/associations/many_to_one_spec.rb +0 -117
  71. data/spec/integration/associations/one_to_many/custom_fks_spec.rb +0 -54
  72. data/spec/integration/associations/one_to_many/from_view_spec.rb +0 -57
  73. data/spec/integration/associations/one_to_many/self_ref_spec.rb +0 -54
  74. data/spec/integration/associations/one_to_many_spec.rb +0 -86
  75. data/spec/integration/associations/one_to_one_spec.rb +0 -69
  76. data/spec/integration/associations/one_to_one_through_spec.rb +0 -92
  77. data/spec/integration/auto_migrations/errors_spec.rb +0 -31
  78. data/spec/integration/auto_migrations/indexes_spec.rb +0 -253
  79. data/spec/integration/auto_migrations/managing_columns_spec.rb +0 -156
  80. data/spec/integration/auto_migrations/postgres/column_types_spec.rb +0 -63
  81. data/spec/integration/combine_with_spec.rb +0 -43
  82. data/spec/integration/commands/create_spec.rb +0 -304
  83. data/spec/integration/commands/delete_spec.rb +0 -84
  84. data/spec/integration/commands/update_spec.rb +0 -90
  85. data/spec/integration/commands/upsert_spec.rb +0 -83
  86. data/spec/integration/gateway_spec.rb +0 -107
  87. data/spec/integration/migration_spec.rb +0 -55
  88. data/spec/integration/plugins/associates/many_to_many_spec.rb +0 -69
  89. data/spec/integration/plugins/associates_spec.rb +0 -250
  90. data/spec/integration/plugins/auto_restrictions_spec.rb +0 -74
  91. data/spec/integration/relation_schema_spec.rb +0 -271
  92. data/spec/integration/schema/call_spec.rb +0 -24
  93. data/spec/integration/schema/inferrer/mysql_spec.rb +0 -45
  94. data/spec/integration/schema/inferrer/postgres_spec.rb +0 -203
  95. data/spec/integration/schema/inferrer/sqlite_spec.rb +0 -37
  96. data/spec/integration/schema/inferrer_spec.rb +0 -390
  97. data/spec/integration/schema/prefix_spec.rb +0 -16
  98. data/spec/integration/schema/qualified_spec.rb +0 -16
  99. data/spec/integration/schema/rename_spec.rb +0 -21
  100. data/spec/integration/schema/view_spec.rb +0 -29
  101. data/spec/integration/sequel_api_spec.rb +0 -36
  102. data/spec/integration/setup_spec.rb +0 -26
  103. data/spec/integration/support/active_support_notifications_spec.rb +0 -24
  104. data/spec/integration/support/rails_log_subscriber_spec.rb +0 -30
  105. data/spec/integration/wrap_spec.rb +0 -91
  106. data/spec/shared/accounts.rb +0 -48
  107. data/spec/shared/database_setup.rb +0 -70
  108. data/spec/shared/notes.rb +0 -23
  109. data/spec/shared/posts.rb +0 -34
  110. data/spec/shared/puppies.rb +0 -15
  111. data/spec/shared/relations.rb +0 -8
  112. data/spec/shared/users.rb +0 -32
  113. data/spec/shared/users_and_tasks.rb +0 -50
  114. data/spec/spec_helper.rb +0 -122
  115. data/spec/support/env_helper.rb +0 -25
  116. data/spec/support/helpers.rb +0 -24
  117. data/spec/support/oracle/create_users.sql +0 -7
  118. data/spec/support/oracle/set_sys_passwords.sql +0 -2
  119. data/spec/support/test_configuration.rb +0 -16
  120. data/spec/unit/attribute_spec.rb +0 -104
  121. data/spec/unit/function_spec.rb +0 -48
  122. data/spec/unit/gateway_spec.rb +0 -70
  123. data/spec/unit/logger_spec.rb +0 -14
  124. data/spec/unit/migration_tasks_spec.rb +0 -111
  125. data/spec/unit/migrator_spec.rb +0 -25
  126. data/spec/unit/order_dsl_spec.rb +0 -43
  127. data/spec/unit/plugin/associates_spec.rb +0 -94
  128. data/spec/unit/plugin/pagination_spec.rb +0 -91
  129. data/spec/unit/plugin/timestamp_spec.rb +0 -117
  130. data/spec/unit/projection_dsl_spec.rb +0 -110
  131. data/spec/unit/relation/assoc_spec.rb +0 -87
  132. data/spec/unit/relation/associations_spec.rb +0 -27
  133. data/spec/unit/relation/avg_spec.rb +0 -11
  134. data/spec/unit/relation/by_pk_spec.rb +0 -62
  135. data/spec/unit/relation/dataset_spec.rb +0 -50
  136. data/spec/unit/relation/distinct_spec.rb +0 -15
  137. data/spec/unit/relation/exclude_spec.rb +0 -11
  138. data/spec/unit/relation/exist_predicate_spec.rb +0 -25
  139. data/spec/unit/relation/exists_spec.rb +0 -18
  140. data/spec/unit/relation/fetch_spec.rb +0 -21
  141. data/spec/unit/relation/group_spec.rb +0 -61
  142. data/spec/unit/relation/having_spec.rb +0 -22
  143. data/spec/unit/relation/inner_join_spec.rb +0 -158
  144. data/spec/unit/relation/inspect_spec.rb +0 -11
  145. data/spec/unit/relation/instrument_spec.rb +0 -45
  146. data/spec/unit/relation/invert_spec.rb +0 -11
  147. data/spec/unit/relation/left_join_spec.rb +0 -55
  148. data/spec/unit/relation/lock_spec.rb +0 -93
  149. data/spec/unit/relation/map_spec.rb +0 -16
  150. data/spec/unit/relation/max_spec.rb +0 -11
  151. data/spec/unit/relation/min_spec.rb +0 -11
  152. data/spec/unit/relation/order_spec.rb +0 -51
  153. data/spec/unit/relation/pluck_spec.rb +0 -11
  154. data/spec/unit/relation/prefix_spec.rb +0 -29
  155. data/spec/unit/relation/primary_key_spec.rb +0 -27
  156. data/spec/unit/relation/project_spec.rb +0 -24
  157. data/spec/unit/relation/qualified_columns_spec.rb +0 -30
  158. data/spec/unit/relation/qualified_spec.rb +0 -25
  159. data/spec/unit/relation/read_spec.rb +0 -25
  160. data/spec/unit/relation/rename_spec.rb +0 -23
  161. data/spec/unit/relation/right_join_spec.rb +0 -57
  162. data/spec/unit/relation/select_append_spec.rb +0 -21
  163. data/spec/unit/relation/select_spec.rb +0 -40
  164. data/spec/unit/relation/sum_spec.rb +0 -11
  165. data/spec/unit/relation/union_spec.rb +0 -19
  166. data/spec/unit/relation/unique_predicate_spec.rb +0 -18
  167. data/spec/unit/relation/where_spec.rb +0 -133
  168. data/spec/unit/restriction_dsl_spec.rb +0 -34
  169. data/spec/unit/schema_spec.rb +0 -25
  170. data/spec/unit/types_spec.rb +0 -65
@@ -0,0 +1,94 @@
1
+ module ROM
2
+ module SQL
3
+ class Schema
4
+ # @api private
5
+ class TypeBuilder
6
+ extend Dry::Core::ClassAttributes
7
+
8
+ defines :registry
9
+
10
+ def self.register(db_type, builder)
11
+ registry[db_type] = builder
12
+ end
13
+
14
+ def self.[](db_type)
15
+ registry[db_type]
16
+ end
17
+
18
+ registry Hash.new(new.freeze)
19
+
20
+ defines :ruby_type_mapping, :numeric_pk_type
21
+
22
+ DECIMAL_REGEX = /(?:decimal|numeric)\((\d+)(?:,\s*(\d+))?\)/.freeze
23
+
24
+ ruby_type_mapping(
25
+ integer: Types::Int,
26
+ string: Types::String,
27
+ time: Types::Time,
28
+ date: Types::Date,
29
+ datetime: Types::Time,
30
+ boolean: Types::Bool,
31
+ decimal: Types::Decimal,
32
+ float: Types::Float,
33
+ blob: Types::Blob
34
+ ).freeze
35
+
36
+ numeric_pk_type Types::Serial
37
+
38
+ def call(primary_key:, db_type:, type:, allow_null:, **rest)
39
+ if primary_key
40
+ map_pk_type(type, db_type)
41
+ else
42
+ mapped_type = map_type(type, db_type, rest)
43
+
44
+ if mapped_type
45
+ read_type = mapped_type.meta[:read]
46
+
47
+ if read_type && allow_null
48
+ mapped_type.optional.meta(read: read_type.optional)
49
+ elsif allow_null
50
+ mapped_type.optional
51
+ else
52
+ mapped_type
53
+ end
54
+ end
55
+ end
56
+ end
57
+
58
+ # @api private
59
+ def map_pk_type(_ruby_type, _db_type)
60
+ self.class.numeric_pk_type.meta(primary_key: true)
61
+ end
62
+
63
+ # @api private
64
+ def map_type(ruby_type, db_type, **kw)
65
+ type = self.class.ruby_type_mapping[ruby_type]
66
+
67
+ if db_type.is_a?(String) && db_type.include?('numeric') || db_type.include?('decimal')
68
+ map_decimal_type(db_type)
69
+ elsif db_type.is_a?(String) && db_type.include?('char') && kw[:max_length]
70
+ type.meta(limit: kw[:max_length])
71
+ else
72
+ type
73
+ end
74
+ end
75
+
76
+ # @api private
77
+ def map_decimal_type(type)
78
+ precision = DECIMAL_REGEX.match(type)
79
+
80
+ if precision
81
+ prcsn, scale = precision[1..2].map(&:to_i)
82
+
83
+ self.class.ruby_type_mapping[:decimal].meta(
84
+ precision: prcsn,
85
+ scale: scale
86
+ )
87
+ else
88
+ self.class.ruby_type_mapping[:decimal]
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,30 @@
1
+ module ROM
2
+ module SQL
3
+ class TypeDSL
4
+ attr_reader :definition, :input_constructor, :output_constructor
5
+
6
+ def initialize(value_type)
7
+ if value_type.class < ::Dry::Types::Type
8
+ @definition = value_type
9
+ else
10
+ @definition = ::ROM::SQL::Types.Definition(value_type)
11
+ end
12
+ end
13
+
14
+ def call(&block)
15
+ instance_exec(&block)
16
+
17
+ definition.constructor(input_constructor)
18
+ .meta(read: definition.constructor(output_constructor))
19
+ end
20
+
21
+ def input(&block)
22
+ @input_constructor = block
23
+ end
24
+
25
+ def output(&block)
26
+ @output_constructor = block
27
+ end
28
+ end
29
+ end
30
+ end
@@ -12,9 +12,9 @@ module ROM
12
12
  # @return [Hash]
13
13
  #
14
14
  # @api public
15
- def [](type)
16
- unwrapped = type.optional? ? type.right : type
17
- @types[unwrapped.pristine] || EMPTY_HASH
15
+ def [](wrapped)
16
+ type = wrapped.optional? ? wrapped.right : wrapped
17
+ @types[type.meta[:database]][type.meta[:db_type]] || EMPTY_HASH
18
18
  end
19
19
 
20
20
  # Registers a set of operations supported for a specific type
@@ -30,15 +30,20 @@ module ROM
30
30
  #
31
31
  # @api public
32
32
  def register(type, &block)
33
- raise ArgumentError, "Type #{ type } already registered" if @types.key?(type)
33
+ extensions = @types[type.meta[:database]]
34
+ db_type = type.meta[:db_type]
35
+
36
+ raise ArgumentError, "Type #{ db_type } already registered" if extensions.key?(db_type)
34
37
  mod = Module.new(&block)
35
38
  ctx = Object.new.extend(mod)
36
39
  functions = mod.public_instance_methods.each_with_object({}) { |m, ms| ms[m] = ctx.method(m) }
37
- @types[type] = functions
40
+ extensions[db_type] = functions
38
41
  end
39
42
  end
40
43
 
41
- @types = {}
44
+ @types = ::Hash.new do |hash, database|
45
+ hash[database] = {}
46
+ end
42
47
  end
43
48
  end
44
49
  end
@@ -0,0 +1,46 @@
1
+ require 'dry/core/class_attributes'
2
+
3
+ module ROM
4
+ module SQL
5
+ # @api private
6
+ class TypeSerializer
7
+ extend Dry::Core::ClassAttributes
8
+
9
+ defines :registry
10
+
11
+ def self.register(db_type, builder)
12
+ registry[db_type] = builder
13
+ end
14
+
15
+ def self.[](db_type)
16
+ registry[db_type]
17
+ end
18
+
19
+ registry Hash.new(new.freeze)
20
+
21
+ defines :mapping
22
+
23
+ mapping(
24
+ Types::Int => 'integer',
25
+ Types::String => 'varchar',
26
+ Types::Time => 'timestamp',
27
+ Types::Date => 'date',
28
+ Types::Bool => 'boolean',
29
+ Types::Decimal => 'numeric',
30
+ Types::Float => 'float',
31
+ )
32
+
33
+ def call(type)
34
+ return type.meta[:db_type] if type.meta[:db_type]
35
+
36
+ meta = type.meta[:read] ? { read: type.meta[:read] } : EMPTY_HASH
37
+
38
+ self.class.mapping.fetch(type.with(meta: meta)) {
39
+ if block_given?
40
+ yield(type)
41
+ end or raise "Cannot serialize #{ type }"
42
+ }
43
+ end
44
+ end
45
+ end
46
+ end
data/lib/rom/sql/types.rb CHANGED
@@ -1,4 +1,8 @@
1
+ require 'sequel/core'
2
+ require 'sequel/sql'
3
+
1
4
  require 'rom/types'
5
+ require 'rom/sql/type_dsl'
2
6
 
3
7
  module ROM
4
8
  module SQL
@@ -13,6 +17,14 @@ module ROM
13
17
  ROM::Types.Definition(*args, &block)
14
18
  end
15
19
 
20
+ def self.ForeignKey(relation, type = Types::Int.meta(index: true))
21
+ super
22
+ end
23
+
24
+ def self.define(value_type, &block)
25
+ TypeDSL.new(value_type).call(&block)
26
+ end
27
+
16
28
  Serial = Int.meta(primary_key: true)
17
29
 
18
30
  Blob = Constructor(Sequel::SQL::Blob, &Sequel::SQL::Blob.method(:new))
@@ -1,5 +1,5 @@
1
1
  module ROM
2
2
  module SQL
3
- VERSION = '2.0.0.beta2'.freeze
3
+ VERSION = '2.0.0.beta3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta2
4
+ version: 2.0.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -45,6 +45,9 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.11'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 0.11.1
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,6 +55,9 @@ dependencies:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
57
  version: '0.11'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 0.11.1
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: dry-core
57
63
  requirement: !ruby/object:Gem::Requirement
@@ -129,21 +135,12 @@ executables: []
129
135
  extensions: []
130
136
  extra_rdoc_files: []
131
137
  files:
132
- - ".codeclimate.yml"
133
- - ".gitignore"
134
- - ".rspec"
135
- - ".travis.yml"
136
- - ".yardopts"
137
138
  - CHANGELOG.md
138
- - Gemfile
139
- - Guardfile
140
- - LICENSE.txt
141
139
  - README.md
142
- - Rakefile
143
- - circle.yml
144
140
  - lib/rom-sql.rb
145
141
  - lib/rom/plugins/relation/sql/auto_restrictions.rb
146
142
  - lib/rom/plugins/relation/sql/instrumentation.rb
143
+ - lib/rom/plugins/relation/sql/postgres/explain.rb
147
144
  - lib/rom/sql.rb
148
145
  - lib/rom/sql/associations.rb
149
146
  - lib/rom/sql/associations/core.rb
@@ -165,15 +162,21 @@ files:
165
162
  - lib/rom/sql/extensions.rb
166
163
  - lib/rom/sql/extensions/active_support_notifications.rb
167
164
  - lib/rom/sql/extensions/mysql.rb
168
- - lib/rom/sql/extensions/mysql/attributes_inferrer.rb
165
+ - lib/rom/sql/extensions/mysql/type_builder.rb
169
166
  - lib/rom/sql/extensions/postgres.rb
170
- - lib/rom/sql/extensions/postgres/attributes_inferrer.rb
171
167
  - lib/rom/sql/extensions/postgres/commands.rb
168
+ - lib/rom/sql/extensions/postgres/type_builder.rb
169
+ - lib/rom/sql/extensions/postgres/type_serializer.rb
172
170
  - lib/rom/sql/extensions/postgres/types.rb
171
+ - lib/rom/sql/extensions/postgres/types/array.rb
172
+ - lib/rom/sql/extensions/postgres/types/geometric.rb
173
+ - lib/rom/sql/extensions/postgres/types/json.rb
174
+ - lib/rom/sql/extensions/postgres/types/network.rb
173
175
  - lib/rom/sql/extensions/rails_log_subscriber.rb
174
176
  - lib/rom/sql/extensions/sqlite.rb
175
- - lib/rom/sql/extensions/sqlite/attributes_inferrer.rb
177
+ - lib/rom/sql/extensions/sqlite/type_builder.rb
176
178
  - lib/rom/sql/extensions/sqlite/types.rb
179
+ - lib/rom/sql/foreign_key.rb
177
180
  - lib/rom/sql/function.rb
178
181
  - lib/rom/sql/gateway.rb
179
182
  - lib/rom/sql/group_dsl.rb
@@ -181,8 +184,11 @@ files:
181
184
  - lib/rom/sql/migration.rb
182
185
  - lib/rom/sql/migration/inline_runner.rb
183
186
  - lib/rom/sql/migration/migrator.rb
187
+ - lib/rom/sql/migration/recorder.rb
188
+ - lib/rom/sql/migration/runner.rb
184
189
  - lib/rom/sql/migration/schema_diff.rb
185
190
  - lib/rom/sql/migration/template.rb
191
+ - lib/rom/sql/migration/writer.rb
186
192
  - lib/rom/sql/order_dsl.rb
187
193
  - lib/rom/sql/plugin/associates.rb
188
194
  - lib/rom/sql/plugin/pagination.rb
@@ -192,7 +198,6 @@ files:
192
198
  - lib/rom/sql/rake_task.rb
193
199
  - lib/rom/sql/relation.rb
194
200
  - lib/rom/sql/relation/reading.rb
195
- - lib/rom/sql/relation/sequel_api.rb
196
201
  - lib/rom/sql/relation/writing.rb
197
202
  - lib/rom/sql/restriction_dsl.rb
198
203
  - lib/rom/sql/schema.rb
@@ -201,127 +206,16 @@ files:
201
206
  - lib/rom/sql/schema/dsl.rb
202
207
  - lib/rom/sql/schema/index_dsl.rb
203
208
  - lib/rom/sql/schema/inferrer.rb
209
+ - lib/rom/sql/schema/type_builder.rb
204
210
  - lib/rom/sql/spec/support.rb
205
211
  - lib/rom/sql/tasks/migration_tasks.rake
206
212
  - lib/rom/sql/transaction.rb
213
+ - lib/rom/sql/type_dsl.rb
207
214
  - lib/rom/sql/type_extensions.rb
215
+ - lib/rom/sql/type_serializer.rb
208
216
  - lib/rom/sql/types.rb
209
217
  - lib/rom/sql/version.rb
210
218
  - lib/rom/sql/wrap.rb
211
- - log/.gitkeep
212
- - rom-sql.gemspec
213
- - spec/extensions/postgres/attribute_spec.rb
214
- - spec/extensions/postgres/integration_spec.rb
215
- - spec/extensions/postgres/types_spec.rb
216
- - spec/extensions/sqlite/types_spec.rb
217
- - spec/fixtures/migrations/20150403090603_create_carrots.rb
218
- - spec/integration/associations/many_to_many/custom_fks_spec.rb
219
- - spec/integration/associations/many_to_many/from_view_spec.rb
220
- - spec/integration/associations/many_to_many_spec.rb
221
- - spec/integration/associations/many_to_one/custom_fks_spec.rb
222
- - spec/integration/associations/many_to_one/from_view_spec.rb
223
- - spec/integration/associations/many_to_one/self_ref_spec.rb
224
- - spec/integration/associations/many_to_one_spec.rb
225
- - spec/integration/associations/one_to_many/custom_fks_spec.rb
226
- - spec/integration/associations/one_to_many/from_view_spec.rb
227
- - spec/integration/associations/one_to_many/self_ref_spec.rb
228
- - spec/integration/associations/one_to_many_spec.rb
229
- - spec/integration/associations/one_to_one_spec.rb
230
- - spec/integration/associations/one_to_one_through_spec.rb
231
- - spec/integration/auto_migrations/errors_spec.rb
232
- - spec/integration/auto_migrations/indexes_spec.rb
233
- - spec/integration/auto_migrations/managing_columns_spec.rb
234
- - spec/integration/auto_migrations/postgres/column_types_spec.rb
235
- - spec/integration/combine_with_spec.rb
236
- - spec/integration/commands/create_spec.rb
237
- - spec/integration/commands/delete_spec.rb
238
- - spec/integration/commands/update_spec.rb
239
- - spec/integration/commands/upsert_spec.rb
240
- - spec/integration/gateway_spec.rb
241
- - spec/integration/migration_spec.rb
242
- - spec/integration/plugins/associates/many_to_many_spec.rb
243
- - spec/integration/plugins/associates_spec.rb
244
- - spec/integration/plugins/auto_restrictions_spec.rb
245
- - spec/integration/relation_schema_spec.rb
246
- - spec/integration/schema/call_spec.rb
247
- - spec/integration/schema/inferrer/mysql_spec.rb
248
- - spec/integration/schema/inferrer/postgres_spec.rb
249
- - spec/integration/schema/inferrer/sqlite_spec.rb
250
- - spec/integration/schema/inferrer_spec.rb
251
- - spec/integration/schema/prefix_spec.rb
252
- - spec/integration/schema/qualified_spec.rb
253
- - spec/integration/schema/rename_spec.rb
254
- - spec/integration/schema/view_spec.rb
255
- - spec/integration/sequel_api_spec.rb
256
- - spec/integration/setup_spec.rb
257
- - spec/integration/support/active_support_notifications_spec.rb
258
- - spec/integration/support/rails_log_subscriber_spec.rb
259
- - spec/integration/wrap_spec.rb
260
- - spec/shared/accounts.rb
261
- - spec/shared/database_setup.rb
262
- - spec/shared/notes.rb
263
- - spec/shared/posts.rb
264
- - spec/shared/puppies.rb
265
- - spec/shared/relations.rb
266
- - spec/shared/users.rb
267
- - spec/shared/users_and_tasks.rb
268
- - spec/spec_helper.rb
269
- - spec/support/env_helper.rb
270
- - spec/support/helpers.rb
271
- - spec/support/oracle/create_users.sql
272
- - spec/support/oracle/set_sys_passwords.sql
273
- - spec/support/test_configuration.rb
274
- - spec/unit/attribute_spec.rb
275
- - spec/unit/function_spec.rb
276
- - spec/unit/gateway_spec.rb
277
- - spec/unit/logger_spec.rb
278
- - spec/unit/migration_tasks_spec.rb
279
- - spec/unit/migrator_spec.rb
280
- - spec/unit/order_dsl_spec.rb
281
- - spec/unit/plugin/associates_spec.rb
282
- - spec/unit/plugin/pagination_spec.rb
283
- - spec/unit/plugin/timestamp_spec.rb
284
- - spec/unit/projection_dsl_spec.rb
285
- - spec/unit/relation/assoc_spec.rb
286
- - spec/unit/relation/associations_spec.rb
287
- - spec/unit/relation/avg_spec.rb
288
- - spec/unit/relation/by_pk_spec.rb
289
- - spec/unit/relation/dataset_spec.rb
290
- - spec/unit/relation/distinct_spec.rb
291
- - spec/unit/relation/exclude_spec.rb
292
- - spec/unit/relation/exist_predicate_spec.rb
293
- - spec/unit/relation/exists_spec.rb
294
- - spec/unit/relation/fetch_spec.rb
295
- - spec/unit/relation/group_spec.rb
296
- - spec/unit/relation/having_spec.rb
297
- - spec/unit/relation/inner_join_spec.rb
298
- - spec/unit/relation/inspect_spec.rb
299
- - spec/unit/relation/instrument_spec.rb
300
- - spec/unit/relation/invert_spec.rb
301
- - spec/unit/relation/left_join_spec.rb
302
- - spec/unit/relation/lock_spec.rb
303
- - spec/unit/relation/map_spec.rb
304
- - spec/unit/relation/max_spec.rb
305
- - spec/unit/relation/min_spec.rb
306
- - spec/unit/relation/order_spec.rb
307
- - spec/unit/relation/pluck_spec.rb
308
- - spec/unit/relation/prefix_spec.rb
309
- - spec/unit/relation/primary_key_spec.rb
310
- - spec/unit/relation/project_spec.rb
311
- - spec/unit/relation/qualified_columns_spec.rb
312
- - spec/unit/relation/qualified_spec.rb
313
- - spec/unit/relation/read_spec.rb
314
- - spec/unit/relation/rename_spec.rb
315
- - spec/unit/relation/right_join_spec.rb
316
- - spec/unit/relation/select_append_spec.rb
317
- - spec/unit/relation/select_spec.rb
318
- - spec/unit/relation/sum_spec.rb
319
- - spec/unit/relation/union_spec.rb
320
- - spec/unit/relation/unique_predicate_spec.rb
321
- - spec/unit/relation/where_spec.rb
322
- - spec/unit/restriction_dsl_spec.rb
323
- - spec/unit/schema_spec.rb
324
- - spec/unit/types_spec.rb
325
219
  homepage: http://rom-rb.org
326
220
  licenses:
327
221
  - MIT
@@ -342,120 +236,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
236
  version: 1.3.1
343
237
  requirements: []
344
238
  rubyforge_project:
345
- rubygems_version: 2.6.12
239
+ rubygems_version: 2.6.11
346
240
  signing_key:
347
241
  specification_version: 4
348
242
  summary: SQL databases support for ROM
349
- test_files:
350
- - spec/extensions/postgres/attribute_spec.rb
351
- - spec/extensions/postgres/integration_spec.rb
352
- - spec/extensions/postgres/types_spec.rb
353
- - spec/extensions/sqlite/types_spec.rb
354
- - spec/fixtures/migrations/20150403090603_create_carrots.rb
355
- - spec/integration/associations/many_to_many/custom_fks_spec.rb
356
- - spec/integration/associations/many_to_many/from_view_spec.rb
357
- - spec/integration/associations/many_to_many_spec.rb
358
- - spec/integration/associations/many_to_one/custom_fks_spec.rb
359
- - spec/integration/associations/many_to_one/from_view_spec.rb
360
- - spec/integration/associations/many_to_one/self_ref_spec.rb
361
- - spec/integration/associations/many_to_one_spec.rb
362
- - spec/integration/associations/one_to_many/custom_fks_spec.rb
363
- - spec/integration/associations/one_to_many/from_view_spec.rb
364
- - spec/integration/associations/one_to_many/self_ref_spec.rb
365
- - spec/integration/associations/one_to_many_spec.rb
366
- - spec/integration/associations/one_to_one_spec.rb
367
- - spec/integration/associations/one_to_one_through_spec.rb
368
- - spec/integration/auto_migrations/errors_spec.rb
369
- - spec/integration/auto_migrations/indexes_spec.rb
370
- - spec/integration/auto_migrations/managing_columns_spec.rb
371
- - spec/integration/auto_migrations/postgres/column_types_spec.rb
372
- - spec/integration/combine_with_spec.rb
373
- - spec/integration/commands/create_spec.rb
374
- - spec/integration/commands/delete_spec.rb
375
- - spec/integration/commands/update_spec.rb
376
- - spec/integration/commands/upsert_spec.rb
377
- - spec/integration/gateway_spec.rb
378
- - spec/integration/migration_spec.rb
379
- - spec/integration/plugins/associates/many_to_many_spec.rb
380
- - spec/integration/plugins/associates_spec.rb
381
- - spec/integration/plugins/auto_restrictions_spec.rb
382
- - spec/integration/relation_schema_spec.rb
383
- - spec/integration/schema/call_spec.rb
384
- - spec/integration/schema/inferrer/mysql_spec.rb
385
- - spec/integration/schema/inferrer/postgres_spec.rb
386
- - spec/integration/schema/inferrer/sqlite_spec.rb
387
- - spec/integration/schema/inferrer_spec.rb
388
- - spec/integration/schema/prefix_spec.rb
389
- - spec/integration/schema/qualified_spec.rb
390
- - spec/integration/schema/rename_spec.rb
391
- - spec/integration/schema/view_spec.rb
392
- - spec/integration/sequel_api_spec.rb
393
- - spec/integration/setup_spec.rb
394
- - spec/integration/support/active_support_notifications_spec.rb
395
- - spec/integration/support/rails_log_subscriber_spec.rb
396
- - spec/integration/wrap_spec.rb
397
- - spec/shared/accounts.rb
398
- - spec/shared/database_setup.rb
399
- - spec/shared/notes.rb
400
- - spec/shared/posts.rb
401
- - spec/shared/puppies.rb
402
- - spec/shared/relations.rb
403
- - spec/shared/users.rb
404
- - spec/shared/users_and_tasks.rb
405
- - spec/spec_helper.rb
406
- - spec/support/env_helper.rb
407
- - spec/support/helpers.rb
408
- - spec/support/oracle/create_users.sql
409
- - spec/support/oracle/set_sys_passwords.sql
410
- - spec/support/test_configuration.rb
411
- - spec/unit/attribute_spec.rb
412
- - spec/unit/function_spec.rb
413
- - spec/unit/gateway_spec.rb
414
- - spec/unit/logger_spec.rb
415
- - spec/unit/migration_tasks_spec.rb
416
- - spec/unit/migrator_spec.rb
417
- - spec/unit/order_dsl_spec.rb
418
- - spec/unit/plugin/associates_spec.rb
419
- - spec/unit/plugin/pagination_spec.rb
420
- - spec/unit/plugin/timestamp_spec.rb
421
- - spec/unit/projection_dsl_spec.rb
422
- - spec/unit/relation/assoc_spec.rb
423
- - spec/unit/relation/associations_spec.rb
424
- - spec/unit/relation/avg_spec.rb
425
- - spec/unit/relation/by_pk_spec.rb
426
- - spec/unit/relation/dataset_spec.rb
427
- - spec/unit/relation/distinct_spec.rb
428
- - spec/unit/relation/exclude_spec.rb
429
- - spec/unit/relation/exist_predicate_spec.rb
430
- - spec/unit/relation/exists_spec.rb
431
- - spec/unit/relation/fetch_spec.rb
432
- - spec/unit/relation/group_spec.rb
433
- - spec/unit/relation/having_spec.rb
434
- - spec/unit/relation/inner_join_spec.rb
435
- - spec/unit/relation/inspect_spec.rb
436
- - spec/unit/relation/instrument_spec.rb
437
- - spec/unit/relation/invert_spec.rb
438
- - spec/unit/relation/left_join_spec.rb
439
- - spec/unit/relation/lock_spec.rb
440
- - spec/unit/relation/map_spec.rb
441
- - spec/unit/relation/max_spec.rb
442
- - spec/unit/relation/min_spec.rb
443
- - spec/unit/relation/order_spec.rb
444
- - spec/unit/relation/pluck_spec.rb
445
- - spec/unit/relation/prefix_spec.rb
446
- - spec/unit/relation/primary_key_spec.rb
447
- - spec/unit/relation/project_spec.rb
448
- - spec/unit/relation/qualified_columns_spec.rb
449
- - spec/unit/relation/qualified_spec.rb
450
- - spec/unit/relation/read_spec.rb
451
- - spec/unit/relation/rename_spec.rb
452
- - spec/unit/relation/right_join_spec.rb
453
- - spec/unit/relation/select_append_spec.rb
454
- - spec/unit/relation/select_spec.rb
455
- - spec/unit/relation/sum_spec.rb
456
- - spec/unit/relation/union_spec.rb
457
- - spec/unit/relation/unique_predicate_spec.rb
458
- - spec/unit/relation/where_spec.rb
459
- - spec/unit/restriction_dsl_spec.rb
460
- - spec/unit/schema_spec.rb
461
- - spec/unit/types_spec.rb
243
+ test_files: []