sequel 3.27.0 → 3.28.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/CHANGELOG +96 -0
  2. data/README.rdoc +2 -2
  3. data/Rakefile +1 -1
  4. data/doc/association_basics.rdoc +48 -0
  5. data/doc/opening_databases.rdoc +29 -5
  6. data/doc/prepared_statements.rdoc +1 -0
  7. data/doc/release_notes/3.28.0.txt +304 -0
  8. data/doc/testing.rdoc +42 -0
  9. data/doc/transactions.rdoc +97 -0
  10. data/lib/sequel/adapters/db2.rb +95 -65
  11. data/lib/sequel/adapters/firebird.rb +25 -219
  12. data/lib/sequel/adapters/ibmdb.rb +440 -0
  13. data/lib/sequel/adapters/jdbc.rb +12 -0
  14. data/lib/sequel/adapters/jdbc/as400.rb +0 -7
  15. data/lib/sequel/adapters/jdbc/db2.rb +49 -0
  16. data/lib/sequel/adapters/jdbc/firebird.rb +34 -0
  17. data/lib/sequel/adapters/jdbc/oracle.rb +2 -27
  18. data/lib/sequel/adapters/jdbc/transactions.rb +34 -0
  19. data/lib/sequel/adapters/mysql.rb +10 -15
  20. data/lib/sequel/adapters/odbc.rb +1 -2
  21. data/lib/sequel/adapters/odbc/db2.rb +5 -5
  22. data/lib/sequel/adapters/postgres.rb +71 -11
  23. data/lib/sequel/adapters/shared/db2.rb +290 -0
  24. data/lib/sequel/adapters/shared/firebird.rb +214 -0
  25. data/lib/sequel/adapters/shared/mssql.rb +18 -75
  26. data/lib/sequel/adapters/shared/mysql.rb +13 -0
  27. data/lib/sequel/adapters/shared/postgres.rb +52 -36
  28. data/lib/sequel/adapters/shared/sqlite.rb +32 -36
  29. data/lib/sequel/adapters/sqlite.rb +4 -8
  30. data/lib/sequel/adapters/tinytds.rb +7 -3
  31. data/lib/sequel/adapters/utils/emulate_offset_with_row_number.rb +55 -0
  32. data/lib/sequel/core.rb +1 -1
  33. data/lib/sequel/database/connecting.rb +1 -1
  34. data/lib/sequel/database/misc.rb +6 -5
  35. data/lib/sequel/database/query.rb +1 -1
  36. data/lib/sequel/database/schema_generator.rb +2 -1
  37. data/lib/sequel/dataset/actions.rb +149 -33
  38. data/lib/sequel/dataset/features.rb +44 -7
  39. data/lib/sequel/dataset/misc.rb +9 -1
  40. data/lib/sequel/dataset/prepared_statements.rb +2 -2
  41. data/lib/sequel/dataset/query.rb +63 -10
  42. data/lib/sequel/dataset/sql.rb +22 -5
  43. data/lib/sequel/model.rb +3 -3
  44. data/lib/sequel/model/associations.rb +250 -27
  45. data/lib/sequel/model/base.rb +10 -16
  46. data/lib/sequel/plugins/many_through_many.rb +34 -2
  47. data/lib/sequel/plugins/prepared_statements_with_pk.rb +1 -1
  48. data/lib/sequel/sql.rb +94 -51
  49. data/lib/sequel/version.rb +1 -1
  50. data/spec/adapters/db2_spec.rb +146 -0
  51. data/spec/adapters/postgres_spec.rb +74 -6
  52. data/spec/adapters/spec_helper.rb +1 -0
  53. data/spec/adapters/sqlite_spec.rb +11 -0
  54. data/spec/core/database_spec.rb +7 -0
  55. data/spec/core/dataset_spec.rb +180 -17
  56. data/spec/core/expression_filters_spec.rb +107 -41
  57. data/spec/core/spec_helper.rb +11 -0
  58. data/spec/extensions/many_through_many_spec.rb +115 -1
  59. data/spec/extensions/prepared_statements_with_pk_spec.rb +3 -3
  60. data/spec/integration/associations_test.rb +193 -15
  61. data/spec/integration/database_test.rb +4 -2
  62. data/spec/integration/dataset_test.rb +215 -19
  63. data/spec/integration/plugin_test.rb +8 -5
  64. data/spec/integration/prepared_statement_test.rb +91 -98
  65. data/spec/integration/schema_test.rb +27 -11
  66. data/spec/integration/spec_helper.rb +10 -0
  67. data/spec/integration/type_test.rb +2 -2
  68. data/spec/model/association_reflection_spec.rb +91 -0
  69. data/spec/model/associations_spec.rb +13 -0
  70. data/spec/model/base_spec.rb +8 -21
  71. data/spec/model/eager_loading_spec.rb +243 -9
  72. data/spec/model/model_spec.rb +15 -2
  73. metadata +16 -4
@@ -12,13 +12,20 @@ describe "Sequel::Model()" do
12
12
  c.dataset.should == ds
13
13
  end
14
14
 
15
- it "should return a model subclass with a dataset with the default database and given table name if given a symbol" do
15
+ it "should return a model subclass with a dataset with the default database and given table name if given a Symbol" do
16
16
  c = Sequel::Model(:blah)
17
17
  c.superclass.should == Sequel::Model
18
18
  c.db.should == @db
19
19
  c.table_name.should == :blah
20
20
  end
21
21
 
22
+ it "should return a model subclass with a dataset with the default database and given table name if given a LiteralString" do
23
+ c = Sequel::Model('blah'.lit)
24
+ c.superclass.should == Sequel::Model
25
+ c.db.should == @db
26
+ c.table_name.should == 'blah'.lit
27
+ end
28
+
22
29
  it "should return a model subclass with a dataset with the default database and given table name if given an SQL::Identifier" do
23
30
  c = Sequel::Model(:blah.identifier)
24
31
  c.superclass.should == Sequel::Model
@@ -162,12 +169,18 @@ describe Sequel::Model, "dataset & schema" do
162
169
  @model.table_name.should == :foo
163
170
  end
164
171
 
165
- it "set_dataset should take a symbol" do
172
+ it "set_dataset should take a Symbol" do
166
173
  @model.db = MODEL_DB
167
174
  @model.set_dataset(:foo)
168
175
  @model.table_name.should == :foo
169
176
  end
170
177
 
178
+ it "set_dataset should take a LiteralString" do
179
+ @model.db = MODEL_DB
180
+ @model.set_dataset('foo'.lit)
181
+ @model.table_name.should == 'foo'.lit
182
+ end
183
+
171
184
  it "set_dataset should take an SQL::Identifier" do
172
185
  @model.db = MODEL_DB
173
186
  @model.set_dataset(:foo.identifier)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 107
4
+ hash: 119
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
- - 27
8
+ - 28
9
9
  - 0
10
- version: 3.27.0
10
+ version: 3.28.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Evans
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-01 00:00:00 -07:00
18
+ date: 2011-10-03 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -48,6 +48,7 @@ extra_rdoc_files:
48
48
  - doc/mass_assignment.rdoc
49
49
  - doc/testing.rdoc
50
50
  - doc/schema_modification.rdoc
51
+ - doc/transactions.rdoc
51
52
  - doc/release_notes/1.0.txt
52
53
  - doc/release_notes/1.1.txt
53
54
  - doc/release_notes/1.3.txt
@@ -94,6 +95,7 @@ extra_rdoc_files:
94
95
  - doc/release_notes/3.9.0.txt
95
96
  - doc/release_notes/3.26.0.txt
96
97
  - doc/release_notes/3.27.0.txt
98
+ - doc/release_notes/3.28.0.txt
97
99
  files:
98
100
  - MIT-LICENSE
99
101
  - CHANGELOG
@@ -158,6 +160,7 @@ files:
158
160
  - doc/release_notes/3.9.0.txt
159
161
  - doc/release_notes/3.26.0.txt
160
162
  - doc/release_notes/3.27.0.txt
163
+ - doc/release_notes/3.28.0.txt
161
164
  - doc/sharding.rdoc
162
165
  - doc/sql.rdoc
163
166
  - doc/validations.rdoc
@@ -165,6 +168,7 @@ files:
165
168
  - doc/mass_assignment.rdoc
166
169
  - doc/testing.rdoc
167
170
  - doc/schema_modification.rdoc
171
+ - doc/transactions.rdoc
168
172
  - spec/adapters/firebird_spec.rb
169
173
  - spec/adapters/informix_spec.rb
170
174
  - spec/adapters/mssql_spec.rb
@@ -173,6 +177,7 @@ files:
173
177
  - spec/adapters/postgres_spec.rb
174
178
  - spec/adapters/spec_helper.rb
175
179
  - spec/adapters/sqlite_spec.rb
180
+ - spec/adapters/db2_spec.rb
176
181
  - spec/core/connection_pool_spec.rb
177
182
  - spec/core/core_sql_spec.rb
178
183
  - spec/core/database_spec.rb
@@ -332,6 +337,9 @@ files:
332
337
  - lib/sequel/adapters/jdbc/informix.rb
333
338
  - lib/sequel/adapters/jdbc/jtds.rb
334
339
  - lib/sequel/adapters/jdbc/sqlserver.rb
340
+ - lib/sequel/adapters/jdbc/db2.rb
341
+ - lib/sequel/adapters/jdbc/transactions.rb
342
+ - lib/sequel/adapters/jdbc/firebird.rb
335
343
  - lib/sequel/adapters/mysql.rb
336
344
  - lib/sequel/adapters/odbc.rb
337
345
  - lib/sequel/adapters/odbc/mssql.rb
@@ -348,14 +356,18 @@ files:
348
356
  - lib/sequel/adapters/shared/access.rb
349
357
  - lib/sequel/adapters/shared/informix.rb
350
358
  - lib/sequel/adapters/shared/mysql_prepared_statements.rb
359
+ - lib/sequel/adapters/shared/db2.rb
360
+ - lib/sequel/adapters/shared/firebird.rb
351
361
  - lib/sequel/adapters/sqlite.rb
352
362
  - lib/sequel/adapters/utils/stored_procedures.rb
363
+ - lib/sequel/adapters/utils/emulate_offset_with_row_number.rb
353
364
  - lib/sequel/adapters/mysql2.rb
354
365
  - lib/sequel/adapters/swift.rb
355
366
  - lib/sequel/adapters/swift/mysql.rb
356
367
  - lib/sequel/adapters/swift/postgres.rb
357
368
  - lib/sequel/adapters/swift/sqlite.rb
358
369
  - lib/sequel/adapters/tinytds.rb
370
+ - lib/sequel/adapters/ibmdb.rb
359
371
  - lib/sequel/connection_pool.rb
360
372
  - lib/sequel/connection_pool/sharded_single.rb
361
373
  - lib/sequel/connection_pool/sharded_threaded.rb