pg 1.4.6-x64-mingw-ucrt → 1.5.0-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.appveyor.yml +1 -1
- data/.gitignore +3 -0
- data/History.md +55 -0
- data/README.ja.md +29 -19
- data/README.md +29 -15
- data/Rakefile.cross +1 -1
- data/ext/pg.c +10 -28
- data/ext/pg.h +10 -5
- data/ext/pg_binary_decoder.c +79 -0
- data/ext/pg_binary_encoder.c +224 -0
- data/ext/pg_coder.c +16 -7
- data/ext/pg_connection.c +50 -34
- data/ext/pg_copy_coder.c +306 -17
- data/ext/pg_record_coder.c +5 -4
- data/ext/pg_result.c +88 -17
- data/ext/pg_text_decoder.c +28 -10
- data/ext/pg_text_encoder.c +22 -9
- data/ext/pg_tuple.c +34 -31
- data/ext/pg_type_map.c +3 -2
- data/ext/pg_type_map_all_strings.c +2 -2
- data/ext/pg_type_map_by_class.c +5 -3
- data/ext/pg_type_map_by_column.c +9 -3
- data/ext/pg_type_map_by_oid.c +7 -4
- data/ext/pg_type_map_in_ruby.c +5 -2
- data/lib/3.1/pg_ext.so +0 -0
- data/lib/3.2/pg_ext.so +0 -0
- data/lib/pg/basic_type_map_based_on_result.rb +21 -1
- data/lib/pg/basic_type_map_for_queries.rb +13 -8
- data/lib/pg/basic_type_map_for_results.rb +26 -3
- data/lib/pg/basic_type_registry.rb +30 -32
- data/lib/pg/binary_decoder/date.rb +9 -0
- data/lib/pg/binary_decoder/timestamp.rb +26 -0
- data/lib/pg/binary_encoder/timestamp.rb +20 -0
- data/lib/pg/coder.rb +15 -13
- data/lib/pg/connection.rb +63 -12
- data/lib/pg/text_decoder/date.rb +18 -0
- data/lib/pg/text_decoder/inet.rb +9 -0
- data/lib/pg/text_decoder/json.rb +14 -0
- data/lib/pg/text_decoder/numeric.rb +9 -0
- data/lib/pg/text_decoder/timestamp.rb +30 -0
- data/lib/pg/text_encoder/date.rb +12 -0
- data/lib/pg/text_encoder/inet.rb +28 -0
- data/lib/pg/text_encoder/json.rb +14 -0
- data/lib/pg/text_encoder/numeric.rb +9 -0
- data/lib/pg/text_encoder/timestamp.rb +24 -0
- data/lib/pg/version.rb +1 -1
- data/lib/pg.rb +44 -9
- data/lib/x64-mingw-ucrt/libpq.dll +0 -0
- data/pg.gemspec +1 -1
- data/translation/po/all.pot +170 -135
- data/translation/po/ja.po +365 -186
- data/translation/po4a.cfg +4 -1
- data.tar.gz.sig +0 -0
- metadata +28 -10
- metadata.gz.sig +0 -0
- data/lib/pg/binary_decoder.rb +0 -23
- data/lib/pg/constants.rb +0 -12
- data/lib/pg/text_decoder.rb +0 -46
- data/lib/pg/text_encoder.rb +0 -59
data/translation/po4a.cfg
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: x64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
Dzx/gFSOrRoCt2mXNgrmcAfr386AfaMvCh7cXqdxZwmVo7ILZCYXck0pajvubsDd
|
35
35
|
NUIIFkVXvd1odFyK9LF1RFAtxn/iAmpx
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2023-
|
37
|
+
date: 2023-04-24 00:00:00.000000000 Z
|
38
38
|
dependencies: []
|
39
39
|
description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
|
40
40
|
9.3 and later.
|
@@ -79,14 +79,23 @@ extra_rdoc_files:
|
|
79
79
|
- lib/pg/basic_type_map_for_queries.rb
|
80
80
|
- lib/pg/basic_type_map_for_results.rb
|
81
81
|
- lib/pg/basic_type_registry.rb
|
82
|
-
- lib/pg/binary_decoder.rb
|
82
|
+
- lib/pg/binary_decoder/date.rb
|
83
|
+
- lib/pg/binary_decoder/timestamp.rb
|
84
|
+
- lib/pg/binary_encoder/timestamp.rb
|
83
85
|
- lib/pg/coder.rb
|
84
86
|
- lib/pg/connection.rb
|
85
|
-
- lib/pg/constants.rb
|
86
87
|
- lib/pg/exceptions.rb
|
87
88
|
- lib/pg/result.rb
|
88
|
-
- lib/pg/text_decoder.rb
|
89
|
-
- lib/pg/
|
89
|
+
- lib/pg/text_decoder/date.rb
|
90
|
+
- lib/pg/text_decoder/inet.rb
|
91
|
+
- lib/pg/text_decoder/json.rb
|
92
|
+
- lib/pg/text_decoder/numeric.rb
|
93
|
+
- lib/pg/text_decoder/timestamp.rb
|
94
|
+
- lib/pg/text_encoder/date.rb
|
95
|
+
- lib/pg/text_encoder/inet.rb
|
96
|
+
- lib/pg/text_encoder/json.rb
|
97
|
+
- lib/pg/text_encoder/numeric.rb
|
98
|
+
- lib/pg/text_encoder/timestamp.rb
|
90
99
|
- lib/pg/tuple.rb
|
91
100
|
- lib/pg/type_map_by_column.rb
|
92
101
|
- lib/pg/version.rb
|
@@ -157,14 +166,23 @@ files:
|
|
157
166
|
- lib/pg/basic_type_map_for_queries.rb
|
158
167
|
- lib/pg/basic_type_map_for_results.rb
|
159
168
|
- lib/pg/basic_type_registry.rb
|
160
|
-
- lib/pg/binary_decoder.rb
|
169
|
+
- lib/pg/binary_decoder/date.rb
|
170
|
+
- lib/pg/binary_decoder/timestamp.rb
|
171
|
+
- lib/pg/binary_encoder/timestamp.rb
|
161
172
|
- lib/pg/coder.rb
|
162
173
|
- lib/pg/connection.rb
|
163
|
-
- lib/pg/constants.rb
|
164
174
|
- lib/pg/exceptions.rb
|
165
175
|
- lib/pg/result.rb
|
166
|
-
- lib/pg/text_decoder.rb
|
167
|
-
- lib/pg/
|
176
|
+
- lib/pg/text_decoder/date.rb
|
177
|
+
- lib/pg/text_decoder/inet.rb
|
178
|
+
- lib/pg/text_decoder/json.rb
|
179
|
+
- lib/pg/text_decoder/numeric.rb
|
180
|
+
- lib/pg/text_decoder/timestamp.rb
|
181
|
+
- lib/pg/text_encoder/date.rb
|
182
|
+
- lib/pg/text_encoder/inet.rb
|
183
|
+
- lib/pg/text_encoder/json.rb
|
184
|
+
- lib/pg/text_encoder/numeric.rb
|
185
|
+
- lib/pg/text_encoder/timestamp.rb
|
168
186
|
- lib/pg/tuple.rb
|
169
187
|
- lib/pg/type_map_by_column.rb
|
170
188
|
- lib/pg/version.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/pg/binary_decoder.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module PG
|
5
|
-
module BinaryDecoder
|
6
|
-
# Convenience classes for timezone options
|
7
|
-
class TimestampUtc < Timestamp
|
8
|
-
def initialize(params={})
|
9
|
-
super(params.merge(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC))
|
10
|
-
end
|
11
|
-
end
|
12
|
-
class TimestampUtcToLocal < Timestamp
|
13
|
-
def initialize(params={})
|
14
|
-
super(params.merge(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL))
|
15
|
-
end
|
16
|
-
end
|
17
|
-
class TimestampLocal < Timestamp
|
18
|
-
def initialize(params={})
|
19
|
-
super(params.merge(flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL))
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end # module PG
|
data/lib/pg/constants.rb
DELETED
data/lib/pg/text_decoder.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'date'
|
5
|
-
require 'json'
|
6
|
-
|
7
|
-
module PG
|
8
|
-
module TextDecoder
|
9
|
-
class Date < SimpleDecoder
|
10
|
-
def decode(string, tuple=nil, field=nil)
|
11
|
-
if string =~ /\A(\d{4})-(\d\d)-(\d\d)\z/
|
12
|
-
::Date.new $1.to_i, $2.to_i, $3.to_i
|
13
|
-
else
|
14
|
-
string
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class JSON < SimpleDecoder
|
20
|
-
def decode(string, tuple=nil, field=nil)
|
21
|
-
::JSON.parse(string, quirks_mode: true)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# Convenience classes for timezone options
|
26
|
-
class TimestampUtc < Timestamp
|
27
|
-
def initialize(params={})
|
28
|
-
super(params.merge(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC))
|
29
|
-
end
|
30
|
-
end
|
31
|
-
class TimestampUtcToLocal < Timestamp
|
32
|
-
def initialize(params={})
|
33
|
-
super(params.merge(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL))
|
34
|
-
end
|
35
|
-
end
|
36
|
-
class TimestampLocal < Timestamp
|
37
|
-
def initialize(params={})
|
38
|
-
super(params.merge(flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL))
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# For backward compatibility:
|
43
|
-
TimestampWithoutTimeZone = TimestampLocal
|
44
|
-
TimestampWithTimeZone = Timestamp
|
45
|
-
end
|
46
|
-
end # module PG
|
data/lib/pg/text_encoder.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'json'
|
5
|
-
require 'ipaddr'
|
6
|
-
|
7
|
-
module PG
|
8
|
-
module TextEncoder
|
9
|
-
class Date < SimpleEncoder
|
10
|
-
def encode(value)
|
11
|
-
value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d") : value
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class TimestampWithoutTimeZone < SimpleEncoder
|
16
|
-
def encode(value)
|
17
|
-
value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S.%N") : value
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
class TimestampUtc < SimpleEncoder
|
22
|
-
def encode(value)
|
23
|
-
value.respond_to?(:utc) ? value.utc.strftime("%Y-%m-%d %H:%M:%S.%N") : value
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
class TimestampWithTimeZone < SimpleEncoder
|
28
|
-
def encode(value)
|
29
|
-
value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S.%N %:z") : value
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
class JSON < SimpleEncoder
|
34
|
-
def encode(value)
|
35
|
-
::JSON.generate(value, quirks_mode: true)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class Inet < SimpleEncoder
|
40
|
-
def encode(value)
|
41
|
-
case value
|
42
|
-
when IPAddr
|
43
|
-
default_prefix = (value.family == Socket::AF_INET ? 32 : 128)
|
44
|
-
s = value.to_s
|
45
|
-
if value.respond_to?(:prefix)
|
46
|
-
prefix = value.prefix
|
47
|
-
else
|
48
|
-
range = value.to_range
|
49
|
-
prefix = default_prefix - Math.log(((range.end.to_i - range.begin.to_i) + 1), 2).to_i
|
50
|
-
end
|
51
|
-
s << "/" << prefix.to_s if prefix != default_prefix
|
52
|
-
s
|
53
|
-
else
|
54
|
-
value
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end # module PG
|