pg_conn 0.50.0 → 0.52.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d4a247037db05fc559956f4fd4e293c4dc2fe76c57be33aed61aed6e73918d0
4
- data.tar.gz: af4650f527a0866ea9b0d09e63de11ab8b666bc01e3eb2d178e6283e8ecbac9a
3
+ metadata.gz: 4eb14bc0e0da731fe50455d9a2a7826da327d2ceb22d7a87b902fe0e5e2b38a8
4
+ data.tar.gz: a7769e72c3477e973846dffb34946b5ff234c3810dc35ae9cd239cf95e5b3fb6
5
5
  SHA512:
6
- metadata.gz: c26a178586d36c17b2a14d1cd1090896abf9f576c574f3616d8555bcc82ce5b434e436145c0944b0729e044df2ecb22e7923a9206443fc14625c2d8628b5c367
7
- data.tar.gz: 42404a7aeec08776c601fcd29fcb1b97f7ffeddb377b1940913082bc237ed3ae4ac1b75a44997e9ae140553420d78f54f76f3ae4dfc2272457ee62910b4aa031
6
+ metadata.gz: 55b80c0204381dc399d2edeeaddeb505c6b12f98fabf9ff81e7003deec55229a7c8db58b3bbb90a452532f90345df79a9d5e89faa654d94c010437d71750e57f
7
+ data.tar.gz: 77fbabcf5e0eaf85b0bfe487b5f721dc7ee7b5cd7190cdfa32fafc9aa86a664f377f6557860c9a037329a24ae9e9d436e061daf95846863f2725876b5a7c3b0c
@@ -117,7 +117,7 @@ module PgConn
117
117
  end
118
118
 
119
119
  # Return type of the given column or nil if not found
120
- def list_column_type(schema, relation = nil, column)
120
+ def column_type(schema, relation = nil, column)
121
121
  conn.tuples(column_list_type_query(schema, relation, column)).first&.last
122
122
  end
123
123
 
@@ -1,3 +1,3 @@
1
1
  module PgConn
2
- VERSION = "0.50.0"
2
+ VERSION = "0.52.0"
3
3
  end
data/lib/pg_conn.rb CHANGED
@@ -93,6 +93,11 @@ module PgConn
93
93
  end
94
94
  end
95
95
 
96
+ # Simple shorthand for ::quote_value
97
+ def self.quote(value, elem_type: nil, json_type: nil)
98
+ quote_value(value, elem_type: nil, json_type: nil)
99
+ end
100
+
96
101
  # Quote values and concatenate them using ',' as separator
97
102
  def self.quote_values(values, **opts)
98
103
  Literal.new values.map { |value| quote_value(value, **opts) }.join(", ")
@@ -486,6 +491,9 @@ module PgConn
486
491
  def quote_tuple(tuple, **opts) = PgConn.quote_tuple(tuple, json_type: self.default_json_type, **opts)
487
492
  def quote_tuples(tuples, **opts) = PgConn.quote_tuples(tuples, json_type: self.default_json_type, **opts)
488
493
 
494
+ # Simple shorthand for #quote_value
495
+ alias_method :quote, :quote_value
496
+
489
497
  # Quote an array as a list. Eg. ["1", 2] => ('1', 2)
490
498
  def quote_list(values, **opts) = quote_tuples([values], **opts)
491
499
 
@@ -495,10 +503,10 @@ module PgConn
495
503
  #
496
504
  # Note that the fields are retrived from the database so this method is not
497
505
  # as fast as the other quote-methods. It is however very convenient when
498
- # you're testing and need a composite type because record-quoting can
499
- # easily become unwieldly
506
+ # you're testing and need a composite type because record-quoting by hand
507
+ # can easily become unwieldly
500
508
  #
501
- # Also note that there is not class-method variant of this method because
509
+ # Also note that there is no class-method variant of this method because
502
510
  # it requires a connection
503
511
  def quote_record(data, schema_name = nil, type, **opts)
504
512
  quote_record_impl(data, schema_name, type, array: false, **opts)
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.50.0
4
+ version: 0.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen