pg_conn 0.11.0 → 0.12.1
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.
- checksums.yaml +4 -4
- data/lib/pg_conn/version.rb +1 -1
- data/lib/pg_conn.rb +10 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d38593bbd3985871d0047ac1c40a093136f34555b051b8c2bb454549cc6634a
|
4
|
+
data.tar.gz: f72a7ab003ee1450eb7aa654bb7b2ba6234d10f25aeefa90c37df0d9d7b189cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ec6bbd626ab5bfff53639ad774102c5d1ad273b24cb7ad9a3d6c3c2f8852f53c095d3d83451eb6c343ac71b43da7162153bcbd8e9da5a681cb689969786ae6a
|
7
|
+
data.tar.gz: bfa053c3720fc5ffbd52d2d6c0cc763675a21322810a17f3cf95abafef868671eefa6dbb15347b847d2892e1884ee210b19c1827310f17174c402e3a2fa59d81
|
data/lib/pg_conn/version.rb
CHANGED
data/lib/pg_conn.rb
CHANGED
@@ -226,8 +226,11 @@ module PgConn
|
|
226
226
|
end
|
227
227
|
end
|
228
228
|
|
229
|
-
# Quote value as an identifier. Value should be a non-nil string
|
230
|
-
def quote_identifier(s)
|
229
|
+
# Quote value as an identifier. Value should be a non-nil string or a symbol
|
230
|
+
def quote_identifier(s)
|
231
|
+
s = s.to_s if s.is_a?(Symbol)
|
232
|
+
String@pg_connection.escape_identifier(s)
|
233
|
+
end
|
231
234
|
|
232
235
|
# Quote the value as a string. Emit 'null' if value is nil
|
233
236
|
#
|
@@ -249,9 +252,11 @@ module PgConn
|
|
249
252
|
end
|
250
253
|
end
|
251
254
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
+
# Quote array as a parenthesis-enclosed list of identifiers
|
256
|
+
def quote_identifier_list(values) = "(#{values.map { quote_identifier(_1) }.join(', ')})"
|
257
|
+
|
258
|
+
# Quote array as a parenthesis-enclosed list of literals
|
259
|
+
def quote_literal_list(values) = "(#{values.map { quote_literal(_1) }.join(', ')})"
|
255
260
|
|
256
261
|
# :call-seq:
|
257
262
|
# exist?(query)
|