pg 1.4.6-x86-mingw32 → 1.5.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.appveyor.yml +1 -1
  4. data/.gitignore +3 -0
  5. data/History.md +61 -0
  6. data/README.ja.md +29 -19
  7. data/README.md +29 -15
  8. data/Rakefile.cross +1 -1
  9. data/ext/pg.c +10 -28
  10. data/ext/pg.h +10 -5
  11. data/ext/pg_binary_decoder.c +79 -0
  12. data/ext/pg_binary_encoder.c +224 -0
  13. data/ext/pg_coder.c +16 -7
  14. data/ext/pg_connection.c +50 -34
  15. data/ext/pg_copy_coder.c +306 -17
  16. data/ext/pg_record_coder.c +5 -4
  17. data/ext/pg_result.c +88 -17
  18. data/ext/pg_text_decoder.c +28 -10
  19. data/ext/pg_text_encoder.c +22 -9
  20. data/ext/pg_tuple.c +34 -31
  21. data/ext/pg_type_map.c +3 -2
  22. data/ext/pg_type_map_all_strings.c +2 -2
  23. data/ext/pg_type_map_by_class.c +5 -3
  24. data/ext/pg_type_map_by_column.c +9 -3
  25. data/ext/pg_type_map_by_oid.c +7 -4
  26. data/ext/pg_type_map_in_ruby.c +5 -2
  27. data/lib/2.5/pg_ext.so +0 -0
  28. data/lib/2.6/pg_ext.so +0 -0
  29. data/lib/2.7/pg_ext.so +0 -0
  30. data/lib/3.0/pg_ext.so +0 -0
  31. data/lib/3.1/pg_ext.so +0 -0
  32. data/lib/3.2/pg_ext.so +0 -0
  33. data/lib/pg/basic_type_map_based_on_result.rb +21 -1
  34. data/lib/pg/basic_type_map_for_queries.rb +13 -8
  35. data/lib/pg/basic_type_map_for_results.rb +26 -3
  36. data/lib/pg/basic_type_registry.rb +30 -32
  37. data/lib/pg/binary_decoder/date.rb +9 -0
  38. data/lib/pg/binary_decoder/timestamp.rb +26 -0
  39. data/lib/pg/binary_encoder/timestamp.rb +20 -0
  40. data/lib/pg/coder.rb +15 -13
  41. data/lib/pg/connection.rb +63 -12
  42. data/lib/pg/text_decoder/date.rb +18 -0
  43. data/lib/pg/text_decoder/inet.rb +9 -0
  44. data/lib/pg/text_decoder/json.rb +14 -0
  45. data/lib/pg/text_decoder/numeric.rb +9 -0
  46. data/lib/pg/text_decoder/timestamp.rb +30 -0
  47. data/lib/pg/text_encoder/date.rb +12 -0
  48. data/lib/pg/text_encoder/inet.rb +28 -0
  49. data/lib/pg/text_encoder/json.rb +14 -0
  50. data/lib/pg/text_encoder/numeric.rb +9 -0
  51. data/lib/pg/text_encoder/timestamp.rb +24 -0
  52. data/lib/pg/version.rb +1 -1
  53. data/lib/pg.rb +44 -9
  54. data/lib/x86-mingw32/libpq.dll +0 -0
  55. data/pg.gemspec +1 -1
  56. data/translation/po/all.pot +170 -135
  57. data/translation/po/ja.po +365 -186
  58. data/translation/po4a.cfg +4 -1
  59. data.tar.gz.sig +1 -3
  60. metadata +28 -10
  61. metadata.gz.sig +0 -0
  62. data/lib/pg/binary_decoder.rb +0 -23
  63. data/lib/pg/constants.rb +0 -12
  64. data/lib/pg/text_decoder.rb +0 -46
  65. data/lib/pg/text_encoder.rb +0 -59
@@ -0,0 +1,24 @@
1
+ # -*- ruby -*-
2
+ # frozen_string_literal: true
3
+
4
+ module PG
5
+ module TextEncoder
6
+ class TimestampWithoutTimeZone < SimpleEncoder
7
+ def encode(value)
8
+ value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S.%N") : value
9
+ end
10
+ end
11
+
12
+ class TimestampUtc < SimpleEncoder
13
+ def encode(value)
14
+ value.respond_to?(:utc) ? value.utc.strftime("%Y-%m-%d %H:%M:%S.%N") : value
15
+ end
16
+ end
17
+
18
+ class TimestampWithTimeZone < SimpleEncoder
19
+ def encode(value)
20
+ value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S.%N %:z") : value
21
+ end
22
+ end
23
+ end
24
+ end # module PG
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.4.6'
3
+ VERSION = '1.5.1'
4
4
  end
data/lib/pg.rb CHANGED
@@ -63,21 +63,56 @@ module PG
63
63
  Connection.new( *args, &block )
64
64
  end
65
65
 
66
+ if defined?(Ractor.make_shareable)
67
+ def self.make_shareable(obj)
68
+ Ractor.make_shareable(obj)
69
+ end
70
+ else
71
+ def self.make_shareable(obj)
72
+ obj.freeze
73
+ end
74
+ end
75
+
76
+ module BinaryDecoder
77
+ %i[ TimestampUtc TimestampUtcToLocal TimestampLocal ].each do |klass|
78
+ autoload klass, 'pg/binary_decoder/timestamp'
79
+ end
80
+ autoload :Date, 'pg/binary_decoder/date'
81
+ end
82
+ module BinaryEncoder
83
+ %i[ TimestampUtc TimestampLocal ].each do |klass|
84
+ autoload klass, 'pg/binary_encoder/timestamp'
85
+ end
86
+ end
87
+ module TextDecoder
88
+ %i[ TimestampUtc TimestampUtcToLocal TimestampLocal TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
89
+ autoload klass, 'pg/text_decoder/timestamp'
90
+ end
91
+ autoload :Date, 'pg/text_decoder/date'
92
+ autoload :Inet, 'pg/text_decoder/inet'
93
+ autoload :JSON, 'pg/text_decoder/json'
94
+ autoload :Numeric, 'pg/text_decoder/numeric'
95
+ end
96
+ module TextEncoder
97
+ %i[ TimestampUtc TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
98
+ autoload klass, 'pg/text_encoder/timestamp'
99
+ end
100
+ autoload :Date, 'pg/text_encoder/date'
101
+ autoload :Inet, 'pg/text_encoder/inet'
102
+ autoload :JSON, 'pg/text_encoder/json'
103
+ autoload :Numeric, 'pg/text_encoder/numeric'
104
+ end
66
105
 
106
+ autoload :BasicTypeMapBasedOnResult, 'pg/basic_type_map_based_on_result'
107
+ autoload :BasicTypeMapForQueries, 'pg/basic_type_map_for_queries'
108
+ autoload :BasicTypeMapForResults, 'pg/basic_type_map_for_results'
109
+ autoload :BasicTypeRegistry, 'pg/basic_type_registry'
67
110
  require 'pg/exceptions'
68
- require 'pg/constants'
69
111
  require 'pg/coder'
70
- require 'pg/binary_decoder'
71
- require 'pg/text_encoder'
72
- require 'pg/text_decoder'
73
- require 'pg/basic_type_registry'
74
- require 'pg/basic_type_map_based_on_result'
75
- require 'pg/basic_type_map_for_queries'
76
- require 'pg/basic_type_map_for_results'
77
112
  require 'pg/type_map_by_column'
78
113
  require 'pg/connection'
79
114
  require 'pg/result'
80
115
  require 'pg/tuple'
81
- require 'pg/version'
116
+ autoload :VERSION, 'pg/version'
82
117
 
83
118
  end # module PG
Binary file
data/pg.gemspec CHANGED
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.cert_chain = ["certs/ged.pem"]
31
31
  spec.rdoc_options = ["--main", "README.md",
32
32
  "--title", "PG: The Ruby PostgreSQL Driver"]
33
- spec.extra_rdoc_files = `git ls-files -z *.rdoc *.md lib/*.rb lib/*/*.rb ext/*.c ext/*.h`.split("\x0")
33
+ spec.extra_rdoc_files = `git ls-files -z *.rdoc *.md lib/*.rb lib/*/*.rb lib/*/*/*.rb ext/*.c ext/*.h`.split("\x0")
34
34
  end