pg_conn 0.17.1 → 0.17.2

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: 64ed87e1cf308dd73256ca1a3785acee059ffbd8fc30d11303f0b494799b9dcb
4
- data.tar.gz: 21076b277ee98f430d9fa19a882ab4a9242815b749a956ec76a210464517162c
3
+ metadata.gz: ebc1f6ad069daaf41d1bc7d58d40b3215bb53e03ad43de79251361f64ada5bd2
4
+ data.tar.gz: f746cf3be418cd9f5bf712e9ea2e2c549561f98ddb6741f5321464d6b71fb5e3
5
5
  SHA512:
6
- metadata.gz: f657154a19e12be06b0e98668964f3b157745f3bbd90bad5e242416598e4be887c89dc7ae81ec56a109bf51aa66997e563825c43fb6a73d09e09711360a2395b
7
- data.tar.gz: 3b5892c3e8f80dcae50cffef9ea128dab6d1bb349d72115c9cb2b5ceff3f0371c1622851192b78ecea8dc572812af6aa9e1b9133ef119b31f81f0772f7b6239a
6
+ metadata.gz: 347112883473ba9ea49e4b041686b76f6c7c754fb5c438b39d3a7d1ffe1c8c5dbf131653f385700cfdba6023fe25c1090b301fcf701c737cbc586dc80ab74bad
7
+ data.tar.gz: b297c042cf2623f419b9a1aa777c103458b71591f92a8d6461be7a5fddf0c55a176bda3cdcf58fff6cc4d77858e5cdd581836d95c8d9bf7171eb044306006e91
@@ -1,3 +1,3 @@
1
1
  module PgConn
2
- VERSION = "0.17.1"
2
+ VERSION = "0.17.2"
3
3
  end
data/lib/pg_conn.rb CHANGED
@@ -247,7 +247,7 @@ module PgConn
247
247
  # before quoting. This works by default for the regular types Integer,
248
248
  # true/false, Time/Date/DateTime, and arrays. Other types may require
249
249
  # special handling
250
- def quote_literal(value)
250
+ def quote_value(value)
251
251
  case value
252
252
  when String; @pg_connection.escape_literal(value)
253
253
  when Integer, Float; value.to_s
@@ -261,11 +261,22 @@ module PgConn
261
261
  end
262
262
  end
263
263
 
264
- # Quote array as a parenthesis-enclosed list of identifiers
265
- def quote_identifier_list(identifiers) = "(#{identifiers.map { quote_identifier(_1) }.join(', ')})"
266
264
 
267
- # Quote array as a parenthesis-enclosed list of literals
268
- def quote_literal_list(values) = "(#{values.map { quote_literal(_1) }.join(', ')})"
265
+ # Quote array as a comma-separated sequence of identifiers
266
+ def quote_identifier_seq(identifiers) = identifiers.map { quote_identifier(_1) }.join(', ')
267
+
268
+ # Quote array as a parenthesis-enclosed sequence of identifiers
269
+ def quote_identifier_list(identifiers) = "(#{quote_identifier_seq(identifiers)})"
270
+
271
+ # Quote array as a comma-separated sequence of values
272
+ def quote_value_seq(values) = values.map { quote_literal(_1) }.join(', ')
273
+
274
+ # Quote array as a parenthesis-enclosed list of value
275
+ def quote_value_list(values) = "(#{quote_value_seq(values)})"
276
+
277
+ # Old aliases. TODO Remove
278
+ def quote_literal(value) = quote_value(value)
279
+ def quote_literal_list(values) = quote_value_list(values)
269
280
 
270
281
  # :call-seq:
271
282
  # exist?(query)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_conn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-04 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg