sequel 4.24.0 → 4.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +40 -0
- data/doc/association_basics.rdoc +2 -5
- data/doc/dataset_basics.rdoc +1 -1
- data/doc/postgresql.rdoc +47 -0
- data/doc/querying.rdoc +5 -0
- data/doc/release_notes/4.25.0.txt +181 -0
- data/lib/sequel/adapters/ibmdb.rb +0 -28
- data/lib/sequel/adapters/shared/db2.rb +31 -2
- data/lib/sequel/adapters/shared/mssql.rb +12 -12
- data/lib/sequel/adapters/shared/postgres.rb +102 -3
- data/lib/sequel/adapters/shared/sqlite.rb +1 -0
- data/lib/sequel/adapters/swift/sqlite.rb +12 -0
- data/lib/sequel/database/schema_generator.rb +4 -0
- data/lib/sequel/database/schema_methods.rb +3 -1
- data/lib/sequel/dataset/actions.rb +1 -1
- data/lib/sequel/dataset/prepared_statements.rb +15 -7
- data/lib/sequel/dataset/query.rb +16 -2
- data/lib/sequel/dataset/sql.rb +19 -16
- data/lib/sequel/extensions/empty_array_consider_nulls.rb +35 -0
- data/lib/sequel/extensions/empty_array_ignore_nulls.rb +3 -34
- data/lib/sequel/extensions/pg_json_ops.rb +9 -1
- data/lib/sequel/extensions/query_literals.rb +1 -1
- data/lib/sequel/model/base.rb +7 -11
- data/lib/sequel/model/dataset_module.rb +1 -1
- data/lib/sequel/plugins/association_pks.rb +6 -0
- data/lib/sequel/plugins/dirty.rb +6 -1
- data/lib/sequel/plugins/inverted_subsets.rb +48 -0
- data/lib/sequel/plugins/serialization.rb +2 -0
- data/lib/sequel/plugins/singular_table_names.rb +31 -0
- data/lib/sequel/plugins/static_cache.rb +17 -0
- data/lib/sequel/sql.rb +1 -0
- data/lib/sequel/version.rb +1 -1
- data/spec/adapters/db2_spec.rb +12 -0
- data/spec/adapters/mysql_spec.rb +1 -0
- data/spec/adapters/postgres_spec.rb +41 -1
- data/spec/core/database_spec.rb +1 -0
- data/spec/core/dataset_spec.rb +55 -7
- data/spec/core/expression_filters_spec.rb +18 -0
- data/spec/core/schema_spec.rb +10 -2
- data/spec/extensions/association_pks_spec.rb +12 -0
- data/spec/extensions/{empty_array_ignore_nulls_spec.rb → empty_array_consider_nulls_spec.rb} +7 -7
- data/spec/extensions/inverted_subsets_spec.rb +33 -0
- data/spec/extensions/query_literals_spec.rb +16 -0
- data/spec/extensions/serialization_spec.rb +21 -0
- data/spec/extensions/singular_table_names_spec.rb +22 -0
- data/spec/integration/dataset_test.rb +2 -1
- data/spec/integration/prepared_statement_test.rb +35 -1
- data/spec/model/associations_spec.rb +2 -2
- data/spec/model/base_spec.rb +13 -8
- data/spec/model/class_dataset_methods_spec.rb +1 -0
- metadata +10 -5
- data/lib/sequel/adapters/firebird.rb +0 -105
- 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
|