sequel 4.24.0 → 4.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +40 -0
  3. data/doc/association_basics.rdoc +2 -5
  4. data/doc/dataset_basics.rdoc +1 -1
  5. data/doc/postgresql.rdoc +47 -0
  6. data/doc/querying.rdoc +5 -0
  7. data/doc/release_notes/4.25.0.txt +181 -0
  8. data/lib/sequel/adapters/ibmdb.rb +0 -28
  9. data/lib/sequel/adapters/shared/db2.rb +31 -2
  10. data/lib/sequel/adapters/shared/mssql.rb +12 -12
  11. data/lib/sequel/adapters/shared/postgres.rb +102 -3
  12. data/lib/sequel/adapters/shared/sqlite.rb +1 -0
  13. data/lib/sequel/adapters/swift/sqlite.rb +12 -0
  14. data/lib/sequel/database/schema_generator.rb +4 -0
  15. data/lib/sequel/database/schema_methods.rb +3 -1
  16. data/lib/sequel/dataset/actions.rb +1 -1
  17. data/lib/sequel/dataset/prepared_statements.rb +15 -7
  18. data/lib/sequel/dataset/query.rb +16 -2
  19. data/lib/sequel/dataset/sql.rb +19 -16
  20. data/lib/sequel/extensions/empty_array_consider_nulls.rb +35 -0
  21. data/lib/sequel/extensions/empty_array_ignore_nulls.rb +3 -34
  22. data/lib/sequel/extensions/pg_json_ops.rb +9 -1
  23. data/lib/sequel/extensions/query_literals.rb +1 -1
  24. data/lib/sequel/model/base.rb +7 -11
  25. data/lib/sequel/model/dataset_module.rb +1 -1
  26. data/lib/sequel/plugins/association_pks.rb +6 -0
  27. data/lib/sequel/plugins/dirty.rb +6 -1
  28. data/lib/sequel/plugins/inverted_subsets.rb +48 -0
  29. data/lib/sequel/plugins/serialization.rb +2 -0
  30. data/lib/sequel/plugins/singular_table_names.rb +31 -0
  31. data/lib/sequel/plugins/static_cache.rb +17 -0
  32. data/lib/sequel/sql.rb +1 -0
  33. data/lib/sequel/version.rb +1 -1
  34. data/spec/adapters/db2_spec.rb +12 -0
  35. data/spec/adapters/mysql_spec.rb +1 -0
  36. data/spec/adapters/postgres_spec.rb +41 -1
  37. data/spec/core/database_spec.rb +1 -0
  38. data/spec/core/dataset_spec.rb +55 -7
  39. data/spec/core/expression_filters_spec.rb +18 -0
  40. data/spec/core/schema_spec.rb +10 -2
  41. data/spec/extensions/association_pks_spec.rb +12 -0
  42. data/spec/extensions/{empty_array_ignore_nulls_spec.rb → empty_array_consider_nulls_spec.rb} +7 -7
  43. data/spec/extensions/inverted_subsets_spec.rb +33 -0
  44. data/spec/extensions/query_literals_spec.rb +16 -0
  45. data/spec/extensions/serialization_spec.rb +21 -0
  46. data/spec/extensions/singular_table_names_spec.rb +22 -0
  47. data/spec/integration/dataset_test.rb +2 -1
  48. data/spec/integration/prepared_statement_test.rb +35 -1
  49. data/spec/model/associations_spec.rb +2 -2
  50. data/spec/model/base_spec.rb +13 -8
  51. data/spec/model/class_dataset_methods_spec.rb +1 -0
  52. metadata +10 -5
  53. data/lib/sequel/adapters/firebird.rb +0 -105
  54. data/lib/sequel/adapters/informix.rb +0 -68
@@ -1,68 +0,0 @@
1
- require 'informix'
2
- Sequel.require 'adapters/shared/informix'
3
- Sequel::Deprecation.deprecate 'The informix adapter is deprecated and will be removed in a future version of Sequel. Please switch to the ibmdb adapter.'
4
-
5
- module Sequel
6
- module Informix
7
- class Database < Sequel::Database
8
- include DatabaseMethods
9
-
10
- set_adapter_scheme :informix
11
-
12
- def connect(server)
13
- opts = server_opts(server)
14
- ::Informix.connect(opts[:database], opts[:user], opts[:password])
15
- end
16
-
17
- def transaction(opts=OPTS)
18
- if @opts[:nolog]
19
- yield
20
- else
21
- super
22
- end
23
- end
24
-
25
- # Returns number of rows affected
26
- def execute_dui(sql, opts=OPTS)
27
- synchronize(opts[:server]){|c| log_yield(sql){c.immediate(sql)}}
28
- end
29
-
30
- def execute_insert(sql, opts=OPTS)
31
- synchronize(opts[:server]){|c|
32
- log_yield(sql){c.immediate(sql)}
33
- c.cursor(%q{select first 1 dbinfo('sqlca.sqlerrd1') from systables}).open.fetch
34
- }
35
- end
36
-
37
- def execute(sql, opts=OPTS)
38
- synchronize(opts[:server]){|c| yield log_yield(sql){c.cursor(sql)}}
39
- end
40
- end
41
-
42
- class Dataset < Sequel::Dataset
43
- include DatasetMethods
44
-
45
- Database::DatasetClass = self
46
-
47
- def fetch_rows(sql)
48
- execute(sql) do |cursor|
49
- begin
50
- col_map = nil
51
- cursor.open.each_hash do |h|
52
- unless col_map
53
- col_map = {}
54
- @columns = h.keys.map{|k| col_map[k] = output_identifier(k)}
55
- end
56
- h2 = {}
57
- h.each{|k,v| h2[col_map[k]||k] = v}
58
- yield h2
59
- end
60
- ensure
61
- cursor.respond_to?(:free) ? cursor.free : cursor.drop
62
- end
63
- end
64
- self
65
- end
66
- end
67
- end
68
- end