autocompl 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/lib/autocompl/repository.rb +11 -1
  3. data/lib/autocompl/version.rb +1 -1
  4. data/test/dummy/log/development.log +467 -0
  5. data/test/dummy/log/test.log +3 -0
  6. data/test/dummy/vendor/bundle/ruby/2.3.0/bin/console +23 -0
  7. data/test/dummy/vendor/bundle/ruby/2.3.0/cache/pg-0.19.0.gem +0 -0
  8. data/test/dummy/vendor/bundle/ruby/2.3.0/cache/pq-0.0.1.gem +0 -0
  9. data/test/dummy/vendor/bundle/ruby/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/pg-0.19.0/gem.build_complete +0 -0
  10. data/test/dummy/vendor/bundle/ruby/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/pg-0.19.0/gem_make.out +78 -0
  11. data/test/dummy/vendor/bundle/ruby/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/pg-0.19.0/mkmf.log +1346 -0
  12. data/test/dummy/vendor/bundle/ruby/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/pg-0.19.0/pg_ext.bundle +0 -0
  13. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/BSDL +22 -0
  14. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ChangeLog +6378 -0
  15. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/Contributors.rdoc +46 -0
  16. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/History.rdoc +363 -0
  17. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/LICENSE +56 -0
  18. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/Manifest.txt +85 -0
  19. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/POSTGRES +23 -0
  20. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/README-OS_X.rdoc +68 -0
  21. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/README-Windows.rdoc +56 -0
  22. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/README.ja.rdoc +14 -0
  23. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/README.rdoc +168 -0
  24. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/Rakefile +216 -0
  25. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/Rakefile.cross +301 -0
  26. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/Makefile +261 -0
  27. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/errorcodes.def +947 -0
  28. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/errorcodes.rb +45 -0
  29. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/errorcodes.txt +467 -0
  30. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/extconf.h +38 -0
  31. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/extconf.rb +112 -0
  32. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/gvl_wrappers.c +13 -0
  33. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/gvl_wrappers.h +257 -0
  34. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/gvl_wrappers.o +0 -0
  35. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg.c +667 -0
  36. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg.h +395 -0
  37. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg.o +0 -0
  38. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_binary_decoder.c +162 -0
  39. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_binary_decoder.o +0 -0
  40. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_binary_encoder.c +162 -0
  41. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_binary_encoder.o +0 -0
  42. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_coder.c +500 -0
  43. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_coder.o +0 -0
  44. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_connection.c +4102 -0
  45. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_connection.o +0 -0
  46. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_copy_coder.c +591 -0
  47. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_copy_coder.o +0 -0
  48. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_errors.c +95 -0
  49. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_errors.o +0 -0
  50. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_ext.bundle +0 -0
  51. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_result.c +1271 -0
  52. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_result.o +0 -0
  53. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_text_decoder.c +421 -0
  54. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_text_decoder.o +0 -0
  55. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_text_encoder.c +683 -0
  56. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_text_encoder.o +0 -0
  57. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map.c +159 -0
  58. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map.o +0 -0
  59. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_all_strings.c +116 -0
  60. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_all_strings.o +0 -0
  61. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_class.c +239 -0
  62. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_class.o +0 -0
  63. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_column.c +312 -0
  64. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_column.o +0 -0
  65. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_mri_type.c +284 -0
  66. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_mri_type.o +0 -0
  67. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_oid.c +355 -0
  68. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_by_oid.o +0 -0
  69. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_in_ruby.c +299 -0
  70. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/pg_type_map_in_ruby.o +0 -0
  71. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/util.c +149 -0
  72. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/util.h +65 -0
  73. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/util.o +0 -0
  74. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/vc/pg.sln +26 -0
  75. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/vc/pg_18/pg.vcproj +216 -0
  76. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/ext/vc/pg_19/pg_19.vcproj +209 -0
  77. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg.rb +64 -0
  78. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/basic_type_mapping.rb +426 -0
  79. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/coder.rb +83 -0
  80. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/connection.rb +271 -0
  81. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/constants.rb +11 -0
  82. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/exceptions.rb +11 -0
  83. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/result.rb +30 -0
  84. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/text_decoder.rb +51 -0
  85. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/text_encoder.rb +35 -0
  86. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg/type_map_by_column.rb +15 -0
  87. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/lib/pg_ext.bundle +0 -0
  88. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/array_insert.rb +20 -0
  89. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/async_api.rb +106 -0
  90. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/async_copyto.rb +39 -0
  91. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/async_mixed.rb +56 -0
  92. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/check_conn.rb +21 -0
  93. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/copyfrom.rb +81 -0
  94. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/copyto.rb +19 -0
  95. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/cursor.rb +21 -0
  96. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/disk_usage_report.rb +186 -0
  97. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/issue-119.rb +94 -0
  98. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/losample.rb +69 -0
  99. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/minimal-testcase.rb +17 -0
  100. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/notify_wait.rb +72 -0
  101. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/pg_statistics.rb +294 -0
  102. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/replication_monitor.rb +231 -0
  103. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/test_binary_values.rb +33 -0
  104. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/wal_shipper.rb +434 -0
  105. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/sample/warehouse_partitions.rb +320 -0
  106. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/data/expected_trace.out +26 -0
  107. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/data/random_binary_data +0 -0
  108. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/helpers.rb +352 -0
  109. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/basic_type_mapping_spec.rb +305 -0
  110. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/connection_spec.rb +1676 -0
  111. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/result_spec.rb +449 -0
  112. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/type_map_by_class_spec.rb +138 -0
  113. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/type_map_by_column_spec.rb +222 -0
  114. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/type_map_by_mri_type_spec.rb +136 -0
  115. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/type_map_by_oid_spec.rb +149 -0
  116. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/type_map_in_ruby_spec.rb +164 -0
  117. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/type_map_spec.rb +22 -0
  118. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg/type_spec.rb +777 -0
  119. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg_spec.rb +50 -0
  120. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/Gemfile +4 -0
  121. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/LICENSE.txt +22 -0
  122. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/README.md +76 -0
  123. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/Rakefile +1 -0
  124. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/bin/console +7 -0
  125. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/lib/pq.rb +99 -0
  126. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/pq.gemspec +29 -0
  127. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/spec/helpers.rb +10 -0
  128. data/test/dummy/vendor/bundle/ruby/2.3.0/gems/pq-0.0.1/spec/queue_spec.rb +84 -0
  129. data/test/dummy/vendor/bundle/ruby/2.3.0/specifications/pg-0.19.0.gemspec +63 -0
  130. data/test/dummy/vendor/bundle/ruby/2.3.0/specifications/pq-0.0.1.gemspec +49 -0
  131. metadata +253 -1
@@ -0,0 +1,209 @@
1
+ <?xml version="1.0" encoding="Windows-1252"?>
2
+ <VisualStudioProject
3
+ ProjectType="Visual C++"
4
+ Version="9.00"
5
+ Name="pg_19"
6
+ ProjectGUID="{2EE30C74-074F-4611-B39B-38D5F3C9B071}"
7
+ RootNamespace="pg_19"
8
+ Keyword="Win32Proj"
9
+ TargetFrameworkVersion="196613"
10
+ >
11
+ <Platforms>
12
+ <Platform
13
+ Name="Win32"
14
+ />
15
+ </Platforms>
16
+ <ToolFiles>
17
+ </ToolFiles>
18
+ <Configurations>
19
+ <Configuration
20
+ Name="Debug|Win32"
21
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
22
+ IntermediateDirectory="$(ConfigurationName)"
23
+ ConfigurationType="2"
24
+ CharacterSet="1"
25
+ >
26
+ <Tool
27
+ Name="VCPreBuildEventTool"
28
+ />
29
+ <Tool
30
+ Name="VCCustomBuildTool"
31
+ />
32
+ <Tool
33
+ Name="VCXMLDataGeneratorTool"
34
+ />
35
+ <Tool
36
+ Name="VCWebServiceProxyGeneratorTool"
37
+ />
38
+ <Tool
39
+ Name="VCMIDLTool"
40
+ />
41
+ <Tool
42
+ Name="VCCLCompilerTool"
43
+ Optimization="0"
44
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PG_19_EXPORTS"
45
+ MinimalRebuild="true"
46
+ BasicRuntimeChecks="3"
47
+ RuntimeLibrary="3"
48
+ UsePrecompiledHeader="2"
49
+ WarningLevel="3"
50
+ DebugInformationFormat="4"
51
+ />
52
+ <Tool
53
+ Name="VCManagedResourceCompilerTool"
54
+ />
55
+ <Tool
56
+ Name="VCResourceCompilerTool"
57
+ />
58
+ <Tool
59
+ Name="VCPreLinkEventTool"
60
+ />
61
+ <Tool
62
+ Name="VCLinkerTool"
63
+ LinkIncremental="2"
64
+ GenerateDebugInformation="true"
65
+ SubSystem="2"
66
+ TargetMachine="1"
67
+ />
68
+ <Tool
69
+ Name="VCALinkTool"
70
+ />
71
+ <Tool
72
+ Name="VCManifestTool"
73
+ />
74
+ <Tool
75
+ Name="VCXDCMakeTool"
76
+ />
77
+ <Tool
78
+ Name="VCBscMakeTool"
79
+ />
80
+ <Tool
81
+ Name="VCFxCopTool"
82
+ />
83
+ <Tool
84
+ Name="VCAppVerifierTool"
85
+ />
86
+ <Tool
87
+ Name="VCPostBuildEventTool"
88
+ />
89
+ </Configuration>
90
+ <Configuration
91
+ Name="Release|Win32"
92
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
93
+ IntermediateDirectory="$(ConfigurationName)"
94
+ ConfigurationType="2"
95
+ CharacterSet="1"
96
+ WholeProgramOptimization="1"
97
+ >
98
+ <Tool
99
+ Name="VCPreBuildEventTool"
100
+ />
101
+ <Tool
102
+ Name="VCCustomBuildTool"
103
+ />
104
+ <Tool
105
+ Name="VCXMLDataGeneratorTool"
106
+ />
107
+ <Tool
108
+ Name="VCWebServiceProxyGeneratorTool"
109
+ />
110
+ <Tool
111
+ Name="VCMIDLTool"
112
+ />
113
+ <Tool
114
+ Name="VCCLCompilerTool"
115
+ Optimization="2"
116
+ EnableIntrinsicFunctions="true"
117
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PG_19_EXPORTS"
118
+ RuntimeLibrary="2"
119
+ EnableFunctionLevelLinking="true"
120
+ UsePrecompiledHeader="2"
121
+ WarningLevel="3"
122
+ DebugInformationFormat="3"
123
+ />
124
+ <Tool
125
+ Name="VCManagedResourceCompilerTool"
126
+ />
127
+ <Tool
128
+ Name="VCResourceCompilerTool"
129
+ />
130
+ <Tool
131
+ Name="VCPreLinkEventTool"
132
+ />
133
+ <Tool
134
+ Name="VCLinkerTool"
135
+ LinkIncremental="1"
136
+ GenerateDebugInformation="true"
137
+ SubSystem="2"
138
+ OptimizeReferences="2"
139
+ EnableCOMDATFolding="2"
140
+ TargetMachine="1"
141
+ />
142
+ <Tool
143
+ Name="VCALinkTool"
144
+ />
145
+ <Tool
146
+ Name="VCManifestTool"
147
+ />
148
+ <Tool
149
+ Name="VCXDCMakeTool"
150
+ />
151
+ <Tool
152
+ Name="VCBscMakeTool"
153
+ />
154
+ <Tool
155
+ Name="VCFxCopTool"
156
+ />
157
+ <Tool
158
+ Name="VCAppVerifierTool"
159
+ />
160
+ <Tool
161
+ Name="VCPostBuildEventTool"
162
+ />
163
+ </Configuration>
164
+ </Configurations>
165
+ <References>
166
+ </References>
167
+ <Files>
168
+ <Filter
169
+ Name="Source Files"
170
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
171
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
172
+ >
173
+ <File
174
+ RelativePath="..\..\compat.c"
175
+ >
176
+ </File>
177
+ <File
178
+ RelativePath="..\..\pg.c"
179
+ >
180
+ </File>
181
+ </Filter>
182
+ <Filter
183
+ Name="Header Files"
184
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
185
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
186
+ >
187
+ <File
188
+ RelativePath="..\..\compat.h"
189
+ >
190
+ </File>
191
+ <File
192
+ RelativePath="..\..\pg.h"
193
+ >
194
+ </File>
195
+ </Filter>
196
+ <Filter
197
+ Name="Resource Files"
198
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
199
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
200
+ >
201
+ </Filter>
202
+ <File
203
+ RelativePath=".\ReadMe.txt"
204
+ >
205
+ </File>
206
+ </Files>
207
+ <Globals>
208
+ </Globals>
209
+ </VisualStudioProject>
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'pg_ext'
5
+ rescue LoadError
6
+ # If it's a Windows binary gem, try the <major>.<minor> subdirectory
7
+ if RUBY_PLATFORM =~/(mswin|mingw)/i
8
+ major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
9
+ raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"
10
+
11
+ # Set the PATH environment variable, so that libpq.dll can be found.
12
+ old_path = ENV['PATH']
13
+ ENV['PATH'] = "#{File.expand_path("..", __FILE__)};#{old_path}"
14
+ require "#{major_minor}/pg_ext"
15
+ ENV['PATH'] = old_path
16
+ else
17
+ raise
18
+ end
19
+
20
+ end
21
+
22
+
23
+ # The top-level PG namespace.
24
+ module PG
25
+
26
+ # Library version
27
+ VERSION = '0.19.0'
28
+
29
+ # VCS revision
30
+ REVISION = %q$Revision: 8beaa5d72670 $
31
+
32
+ class NotAllCopyDataRetrieved < PG::Error
33
+ end
34
+
35
+ ### Get the PG library version. If +include_buildnum+ is +true+, include the build ID.
36
+ def self::version_string( include_buildnum=false )
37
+ vstring = "%s %s" % [ self.name, VERSION ]
38
+ vstring << " (build %s)" % [ REVISION[/: ([[:xdigit:]]+)/, 1] || '0' ] if include_buildnum
39
+ return vstring
40
+ end
41
+
42
+
43
+ ### Convenience alias for PG::Connection.new.
44
+ def self::connect( *args )
45
+ return PG::Connection.new( *args )
46
+ end
47
+
48
+
49
+ require 'pg/exceptions'
50
+ require 'pg/constants'
51
+ require 'pg/coder'
52
+ require 'pg/text_encoder'
53
+ require 'pg/text_decoder'
54
+ require 'pg/basic_type_mapping'
55
+ require 'pg/type_map_by_column'
56
+ require 'pg/connection'
57
+ require 'pg/result'
58
+
59
+ end # module PG
60
+
61
+
62
+ # Backward-compatible aliase
63
+ PGError = PG::Error
64
+
@@ -0,0 +1,426 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pg' unless defined?( PG )
4
+
5
+ module PG::BasicTypeRegistry
6
+ # An instance of this class stores the coders that should be used for a given wire format (text or binary)
7
+ # and type cast direction (encoder or decoder).
8
+ class CoderMap
9
+ # Hash of text types that don't require quotation, when used within composite types.
10
+ # type.name => true
11
+ DONT_QUOTE_TYPES = %w[
12
+ int2 int4 int8
13
+ float4 float8
14
+ oid
15
+ bool
16
+ date timestamp timestamptz
17
+ ].inject({}){|h,e| h[e] = true; h }
18
+
19
+ def initialize(result, coders_by_name, format, arraycoder)
20
+ coder_map = {}
21
+
22
+ _ranges, nodes = result.partition { |row| row['typinput'] == 'range_in' }
23
+ leaves, nodes = nodes.partition { |row| row['typelem'].to_i == 0 }
24
+ arrays, nodes = nodes.partition { |row| row['typinput'] == 'array_in' }
25
+
26
+ # populate the enum types
27
+ _enums, leaves = leaves.partition { |row| row['typinput'] == 'enum_in' }
28
+ # enums.each do |row|
29
+ # coder_map[row['oid'].to_i] = OID::Enum.new
30
+ # end
31
+
32
+ # populate the base types
33
+ leaves.find_all { |row| coders_by_name.key?(row['typname']) }.each do |row|
34
+ coder = coders_by_name[row['typname']].dup
35
+ coder.oid = row['oid'].to_i
36
+ coder.name = row['typname']
37
+ coder.format = format
38
+ coder_map[coder.oid] = coder
39
+ end
40
+
41
+ _records_by_oid = result.group_by { |row| row['oid'] }
42
+
43
+ # populate composite types
44
+ # nodes.each do |row|
45
+ # add_oid row, records_by_oid, coder_map
46
+ # end
47
+
48
+ if arraycoder
49
+ # populate array types
50
+ arrays.each do |row|
51
+ elements_coder = coder_map[row['typelem'].to_i]
52
+ next unless elements_coder
53
+
54
+ coder = arraycoder.new
55
+ coder.oid = row['oid'].to_i
56
+ coder.name = row['typname']
57
+ coder.format = format
58
+ coder.elements_type = elements_coder
59
+ coder.needs_quotation = !DONT_QUOTE_TYPES[elements_coder.name]
60
+ coder_map[coder.oid] = coder
61
+ end
62
+ end
63
+
64
+ # populate range types
65
+ # ranges.find_all { |row| coder_map.key? row['rngsubtype'].to_i }.each do |row|
66
+ # subcoder = coder_map[row['rngsubtype'].to_i]
67
+ # range = OID::Range.new subcoder
68
+ # coder_map[row['oid'].to_i] = range
69
+ # end
70
+
71
+ @coders = coder_map.values
72
+ @coders_by_name = @coders.inject({}){|h, t| h[t.name] = t; h }
73
+ @coders_by_oid = @coders.inject({}){|h, t| h[t.oid] = t; h }
74
+ @typenames_by_oid = result.inject({}){|h, t| h[t['oid'].to_i] = t['typname']; h }
75
+ end
76
+
77
+ attr_reader :coders
78
+ attr_reader :coders_by_oid
79
+ attr_reader :coders_by_name
80
+ attr_reader :typenames_by_oid
81
+
82
+ def coder_by_name(name)
83
+ @coders_by_name[name]
84
+ end
85
+
86
+ def coder_by_oid(oid)
87
+ @coders_by_oid[oid]
88
+ end
89
+ end
90
+
91
+ private
92
+
93
+ def supports_ranges?(connection)
94
+ connection.server_version >= 90200
95
+ end
96
+
97
+ def build_coder_maps(connection)
98
+ if supports_ranges?(connection)
99
+ result = connection.exec <<-SQL
100
+ SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype
101
+ FROM pg_type as t
102
+ LEFT JOIN pg_range as r ON oid = rngtypid
103
+ SQL
104
+ else
105
+ result = connection.exec <<-SQL
106
+ SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput
107
+ FROM pg_type as t
108
+ SQL
109
+ end
110
+
111
+ [
112
+ [0, :encoder, PG::TextEncoder::Array],
113
+ [0, :decoder, PG::TextDecoder::Array],
114
+ [1, :encoder, nil],
115
+ [1, :decoder, nil],
116
+ ].inject([]) do |h, (format, direction, arraycoder)|
117
+ h[format] ||= {}
118
+ h[format][direction] = CoderMap.new result, CODERS_BY_NAME[format][direction], format, arraycoder
119
+ h
120
+ end
121
+ end
122
+
123
+ ValidFormats = { 0 => true, 1 => true }
124
+ ValidDirections = { :encoder => true, :decoder => true }
125
+
126
+ def check_format_and_direction(format, direction)
127
+ raise(ArgumentError, "Invalid format value %p" % format) unless ValidFormats[format]
128
+ raise(ArgumentError, "Invalid direction %p" % direction) unless ValidDirections[direction]
129
+ end
130
+ protected :check_format_and_direction
131
+
132
+ # The key of this hash maps to the `typname` column from the table.
133
+ # encoder_map is then dynamically built with oids as the key and Type
134
+ # objects as values.
135
+ CODERS_BY_NAME = []
136
+
137
+ # Register an OID type named +name+ with a typecasting encoder and decoder object in
138
+ # +type+. +name+ should correspond to the `typname` column in
139
+ # the `pg_type` table.
140
+ def self.register_type(format, name, encoder_class, decoder_class)
141
+ CODERS_BY_NAME[format] ||= { encoder: {}, decoder: {} }
142
+ CODERS_BY_NAME[format][:encoder][name] = encoder_class.new(name: name, format: format) if encoder_class
143
+ CODERS_BY_NAME[format][:decoder][name] = decoder_class.new(name: name, format: format) if decoder_class
144
+ end
145
+
146
+ # Alias the +old+ type to the +new+ type.
147
+ def self.alias_type(format, new, old)
148
+ CODERS_BY_NAME[format][:encoder][new] = CODERS_BY_NAME[format][:encoder][old]
149
+ CODERS_BY_NAME[format][:decoder][new] = CODERS_BY_NAME[format][:decoder][old]
150
+ end
151
+
152
+ register_type 0, 'int2', PG::TextEncoder::Integer, PG::TextDecoder::Integer
153
+ alias_type 0, 'int4', 'int2'
154
+ alias_type 0, 'int8', 'int2'
155
+ alias_type 0, 'oid', 'int2'
156
+
157
+ # register_type 0, 'numeric', OID::Decimal.new
158
+ register_type 0, 'text', PG::TextEncoder::String, PG::TextDecoder::String
159
+ alias_type 0, 'varchar', 'text'
160
+ alias_type 0, 'char', 'text'
161
+ alias_type 0, 'bpchar', 'text'
162
+ alias_type 0, 'xml', 'text'
163
+
164
+ # FIXME: why are we keeping these types as strings?
165
+ # alias_type 'tsvector', 'text'
166
+ # alias_type 'interval', 'text'
167
+ # alias_type 'macaddr', 'text'
168
+ # alias_type 'uuid', 'text'
169
+ #
170
+ # register_type 'money', OID::Money.new
171
+ # There is no PG::TextEncoder::Bytea, because it's simple and more efficient to send bytea-data
172
+ # in binary format, either with PG::BinaryEncoder::Bytea or in Hash param format.
173
+ register_type 0, 'bytea', nil, PG::TextDecoder::Bytea
174
+ register_type 0, 'bool', PG::TextEncoder::Boolean, PG::TextDecoder::Boolean
175
+ # register_type 'bit', OID::Bit.new
176
+ # register_type 'varbit', OID::Bit.new
177
+
178
+ register_type 0, 'float4', PG::TextEncoder::Float, PG::TextDecoder::Float
179
+ alias_type 0, 'float8', 'float4'
180
+
181
+ register_type 0, 'timestamp', PG::TextEncoder::TimestampWithoutTimeZone, PG::TextDecoder::TimestampWithoutTimeZone
182
+ register_type 0, 'timestamptz', PG::TextEncoder::TimestampWithTimeZone, PG::TextDecoder::TimestampWithTimeZone
183
+ register_type 0, 'date', PG::TextEncoder::Date, PG::TextDecoder::Date
184
+ # register_type 'time', OID::Time.new
185
+ #
186
+ # register_type 'path', OID::Text.new
187
+ # register_type 'point', OID::Point.new
188
+ # register_type 'polygon', OID::Text.new
189
+ # register_type 'circle', OID::Text.new
190
+ # register_type 'hstore', OID::Hstore.new
191
+ register_type 0, 'json', PG::TextEncoder::JSON, PG::TextDecoder::JSON
192
+ alias_type 0, 'jsonb', 'json'
193
+ # register_type 'citext', OID::Text.new
194
+ # register_type 'ltree', OID::Text.new
195
+ #
196
+ # register_type 'cidr', OID::Cidr.new
197
+ # alias_type 'inet', 'cidr'
198
+
199
+
200
+
201
+ register_type 1, 'int2', PG::BinaryEncoder::Int2, PG::BinaryDecoder::Integer
202
+ register_type 1, 'int4', PG::BinaryEncoder::Int4, PG::BinaryDecoder::Integer
203
+ register_type 1, 'int8', PG::BinaryEncoder::Int8, PG::BinaryDecoder::Integer
204
+ alias_type 1, 'oid', 'int2'
205
+
206
+ register_type 1, 'text', PG::BinaryEncoder::String, PG::BinaryDecoder::String
207
+ alias_type 1, 'varchar', 'text'
208
+ alias_type 1, 'char', 'text'
209
+ alias_type 1, 'bpchar', 'text'
210
+ alias_type 1, 'xml', 'text'
211
+
212
+ register_type 1, 'bytea', PG::BinaryEncoder::Bytea, PG::BinaryDecoder::Bytea
213
+ register_type 1, 'bool', PG::BinaryEncoder::Boolean, PG::BinaryDecoder::Boolean
214
+ register_type 1, 'float4', nil, PG::BinaryDecoder::Float
215
+ register_type 1, 'float8', nil, PG::BinaryDecoder::Float
216
+ end
217
+
218
+ # Simple set of rules for type casting common PostgreSQL types to Ruby.
219
+ #
220
+ # OIDs of supported type casts are not hard-coded in the sources, but are retrieved from the
221
+ # PostgreSQL's pg_type table in PG::BasicTypeMapForResults.new .
222
+ #
223
+ # Result values are type casted based on the type OID of the given result column.
224
+ #
225
+ # Higher level libraries will most likely not make use of this class, but use their
226
+ # own set of rules to choose suitable encoders and decoders.
227
+ #
228
+ # Example:
229
+ # conn = PG::Connection.new
230
+ # # Assign a default ruleset for type casts of output values.
231
+ # conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn)
232
+ # # Execute a query.
233
+ # res = conn.exec_params( "SELECT $1::INT", ['5'] )
234
+ # # Retrieve and cast the result value. Value format is 0 (text) and OID is 20. Therefore typecasting
235
+ # # is done by PG::TextDecoder::Integer internally for all value retrieval methods.
236
+ # res.values # => [[5]]
237
+ #
238
+ # PG::TypeMapByOid#fit_to_result(result, false) can be used to generate
239
+ # a result independent PG::TypeMapByColumn type map, which can subsequently be used
240
+ # to cast #get_copy_data fields:
241
+ #
242
+ # For the following table:
243
+ # conn.exec( "CREATE TABLE copytable AS VALUES('a', 123, '{5,4,3}'::INT[])" )
244
+ #
245
+ # # Retrieve table OIDs per empty result set.
246
+ # res = conn.exec( "SELECT * FROM copytable LIMIT 0" )
247
+ # # Build a type map for common database to ruby type decoders.
248
+ # btm = PG::BasicTypeMapForResults.new(conn)
249
+ # # Build a PG::TypeMapByColumn with decoders suitable for copytable.
250
+ # tm = btm.build_column_map( res )
251
+ # row_decoder = PG::TextDecoder::CopyRow.new type_map: tm
252
+ #
253
+ # conn.copy_data( "COPY copytable TO STDOUT", row_decoder ) do |res|
254
+ # while row=conn.get_copy_data
255
+ # p row
256
+ # end
257
+ # end
258
+ # This prints the rows with type casted columns:
259
+ # ["a", 123, [5, 4, 3]]
260
+ #
261
+ # See also PG::BasicTypeMapBasedOnResult for the encoder direction.
262
+ class PG::BasicTypeMapForResults < PG::TypeMapByOid
263
+ include PG::BasicTypeRegistry
264
+
265
+ class WarningTypeMap < PG::TypeMapInRuby
266
+ def initialize(typenames)
267
+ @already_warned = Hash.new{|h, k| h[k] = {} }
268
+ @typenames_by_oid = typenames
269
+ end
270
+
271
+ def typecast_result_value(result, _tuple, field)
272
+ format = result.fformat(field)
273
+ oid = result.ftype(field)
274
+ unless @already_warned[format][oid]
275
+ STDERR.puts "Warning: no type cast defined for type #{@typenames_by_oid[format][oid].inspect} with oid #{oid}. Please cast this type explicitly to TEXT to be safe for future changes."
276
+ @already_warned[format][oid] = true
277
+ end
278
+ super
279
+ end
280
+ end
281
+
282
+ def initialize(connection)
283
+ @coder_maps = build_coder_maps(connection)
284
+
285
+ # Populate TypeMapByOid hash with decoders
286
+ @coder_maps.map{|f| f[:decoder].coders }.flatten.each do |coder|
287
+ add_coder(coder)
288
+ end
289
+
290
+ typenames = @coder_maps.map{|f| f[:decoder].typenames_by_oid }
291
+ self.default_type_map = WarningTypeMap.new(typenames)
292
+ end
293
+ end
294
+
295
+ # Simple set of rules for type casting common PostgreSQL types from Ruby
296
+ # to PostgreSQL.
297
+ #
298
+ # OIDs of supported type casts are not hard-coded in the sources, but are retrieved from the
299
+ # PostgreSQL's pg_type table in PG::BasicTypeMapBasedOnResult.new .
300
+ #
301
+ # This class works equal to PG::BasicTypeMapForResults, but does not define decoders for
302
+ # the given result OIDs, but encoders. So it can be used to type cast field values based on
303
+ # the type OID retrieved by a separate SQL query.
304
+ #
305
+ # PG::TypeMapByOid#build_column_map(result) can be used to generate a result independent
306
+ # PG::TypeMapByColumn type map, which can subsequently be used to cast query bind parameters
307
+ # or #put_copy_data fields.
308
+ #
309
+ # Example:
310
+ # conn.exec( "CREATE TEMP TABLE copytable (t TEXT, i INT, ai INT[])" )
311
+ #
312
+ # # Retrieve table OIDs per empty result set.
313
+ # res = conn.exec( "SELECT * FROM copytable LIMIT 0" )
314
+ # # Build a type map for common ruby to database type encoders.
315
+ # btm = PG::BasicTypeMapBasedOnResult.new(conn)
316
+ # # Build a PG::TypeMapByColumn with encoders suitable for copytable.
317
+ # tm = btm.build_column_map( res )
318
+ # row_encoder = PG::TextEncoder::CopyRow.new type_map: tm
319
+ #
320
+ # conn.copy_data( "COPY copytable FROM STDIN", row_encoder ) do |res|
321
+ # conn.put_copy_data ['a', 123, [5,4,3]]
322
+ # end
323
+ # This inserts a single row into copytable with type casts from ruby to
324
+ # database types.
325
+ class PG::BasicTypeMapBasedOnResult < PG::TypeMapByOid
326
+ include PG::BasicTypeRegistry
327
+
328
+ def initialize(connection)
329
+ @coder_maps = build_coder_maps(connection)
330
+
331
+ # Populate TypeMapByOid hash with encoders
332
+ @coder_maps.map{|f| f[:encoder].coders }.flatten.each do |coder|
333
+ add_coder(coder)
334
+ end
335
+ end
336
+ end
337
+
338
+ # Simple set of rules for type casting common Ruby types to PostgreSQL.
339
+ #
340
+ # OIDs of supported type casts are not hard-coded in the sources, but are retrieved from the
341
+ # PostgreSQL's pg_type table in PG::BasicTypeMapForQueries.new .
342
+ #
343
+ # Query params are type casted based on the class of the given value.
344
+ #
345
+ # Higher level libraries will most likely not make use of this class, but use their
346
+ # own derivation of PG::TypeMapByClass or another set of rules to choose suitable
347
+ # encoders and decoders for the values to be sent.
348
+ #
349
+ # Example:
350
+ # conn = PG::Connection.new
351
+ # # Assign a default ruleset for type casts of input and output values.
352
+ # conn.type_map_for_queries = PG::BasicTypeMapForQueries.new(conn)
353
+ # # Execute a query. The Integer param value is typecasted internally by PG::BinaryEncoder::Int8.
354
+ # # The format of the parameter is set to 1 (binary) and the OID of this parameter is set to 20 (int8).
355
+ # res = conn.exec_params( "SELECT $1", [5] )
356
+ class PG::BasicTypeMapForQueries < PG::TypeMapByClass
357
+ include PG::BasicTypeRegistry
358
+
359
+ def initialize(connection)
360
+ @coder_maps = build_coder_maps(connection)
361
+
362
+ populate_encoder_list
363
+ @array_encoders_by_klass = array_encoders_by_klass
364
+ @anyarray_encoder = coder_by_name(0, :encoder, '_any')
365
+ end
366
+
367
+ private
368
+
369
+ def coder_by_name(format, direction, name)
370
+ check_format_and_direction(format, direction)
371
+ @coder_maps[format][direction].coder_by_name(name)
372
+ end
373
+
374
+ def populate_encoder_list
375
+ DEFAULT_TYPE_MAP.each do |klass, selector|
376
+ if Array === selector
377
+ format, name, oid_name = selector
378
+ coder = coder_by_name(format, :encoder, name).dup
379
+ if oid_name
380
+ coder.oid = coder_by_name(format, :encoder, oid_name).oid
381
+ else
382
+ coder.oid = 0
383
+ end
384
+ self[klass] = coder
385
+ else
386
+ self[klass] = selector
387
+ end
388
+ end
389
+ end
390
+
391
+ def array_encoders_by_klass
392
+ DEFAULT_ARRAY_TYPE_MAP.inject({}) do |h, (klass, (format, name))|
393
+ h[klass] = coder_by_name(format, :encoder, name)
394
+ h
395
+ end
396
+ end
397
+
398
+ def get_array_type(value)
399
+ elem = value
400
+ while elem.kind_of?(Array)
401
+ elem = elem.first
402
+ end
403
+ @array_encoders_by_klass[elem.class] ||
404
+ elem.class.ancestors.lazy.map{|ancestor| @array_encoders_by_klass[ancestor] }.find{|a| a } ||
405
+ @anyarray_encoder
406
+ end
407
+
408
+ DEFAULT_TYPE_MAP = {
409
+ TrueClass => [1, 'bool', 'bool'],
410
+ FalseClass => [1, 'bool', 'bool'],
411
+ # We use text format and no type OID for numbers, because setting the OID can lead
412
+ # to unnecessary type conversions on server side.
413
+ Integer => [0, 'int8'],
414
+ Float => [0, 'float8'],
415
+ Array => :get_array_type,
416
+ }
417
+
418
+ DEFAULT_ARRAY_TYPE_MAP = {
419
+ TrueClass => [0, '_bool'],
420
+ FalseClass => [0, '_bool'],
421
+ Integer => [0, '_int8'],
422
+ String => [0, '_text'],
423
+ Float => [0, '_float8'],
424
+ }
425
+
426
+ end