pg_conn 0.11.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 634f61e3bd96889ad4207509c73c8b3e6a78c836db9aecbfc974ec5e206c84da
4
- data.tar.gz: ded665cb58df11f269d951ee0d4cf176c0b99d24c6439edba96f9cf3b03508f0
3
+ metadata.gz: 5d38593bbd3985871d0047ac1c40a093136f34555b051b8c2bb454549cc6634a
4
+ data.tar.gz: f72a7ab003ee1450eb7aa654bb7b2ba6234d10f25aeefa90c37df0d9d7b189cd
5
5
  SHA512:
6
- metadata.gz: 3ad32ff6b5f33b2ec0cd2e309e243177ba1b9b3b5d24281b8e1e2aa8c956f193df64babe15691c80f50807ff7a5dd7c58c966de872b39695354f3aefaaf89343
7
- data.tar.gz: 6bba6d97558b0c7750971dbc23a3d1eacf1c83072c4fcad3d327324e5547d0607b4f427810bfda3fb0e4d27b3e5f679c437fd5a57572309b9156bfc6d313daef
6
+ metadata.gz: 2ec6bbd626ab5bfff53639ad774102c5d1ad273b24cb7ad9a3d6c3c2f8852f53c095d3d83451eb6c343ac71b43da7162153bcbd8e9da5a681cb689969786ae6a
7
+ data.tar.gz: bfa053c3720fc5ffbd52d2d6c0cc763675a21322810a17f3cf95abafef868671eefa6dbb15347b847d2892e1884ee210b19c1827310f17174c402e3a2fa59d81
@@ -1,3 +1,3 @@
1
1
  module PgConn
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.1"
3
3
  end
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) = @pg_connection.escape_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
- def quote_array(value)
253
-
254
- end
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_conn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen