pg_conn 0.27.0 → 0.27.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 +8 -1
- 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: 01735ada71fba436bf8387651722d380b68bfa9c028666946d343e22f94fb1ea
|
4
|
+
data.tar.gz: de757bfe82276b1641c693f93afcc630bcdea37d1bb33d65888652fdce6f3656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d15f076992d6bf1eaa05b5ba8b7f3a3cc7ca4150543449717ecf1a94f16d08d71602e55384dedb13fba4ab06465a8dc1ae1e109ef698cf848d0264243d49e1c5
|
7
|
+
data.tar.gz: 69b9a3cbd175d20e4b806a18124a008eff5ef33bdcfd4d3b482d50cbba20ce95f9684a407b1122cd7dee2464b96496b2803d22c93b2c6190ba52332248a8de4d
|
data/lib/pg_conn/version.rb
CHANGED
data/lib/pg_conn.rb
CHANGED
@@ -983,7 +983,10 @@ module PgConn
|
|
983
983
|
|
984
984
|
# :call-seq
|
985
985
|
# parse_query(query)
|
986
|
-
# parse_query(table,
|
986
|
+
# parse_query(table, id, fields...)
|
987
|
+
# parse_query(table, where_clause, fields...)
|
988
|
+
# parse_query(table, hash, fields...)
|
989
|
+
# parse_query(table, fields...)
|
987
990
|
#
|
988
991
|
# Parse a query. Used in query-functions (#value etc.). The fields argument
|
989
992
|
# can be a list of fields or arrays of fields
|
@@ -998,6 +1001,10 @@ module PgConn
|
|
998
1001
|
case args.first
|
999
1002
|
when Integer; where_clause = "id = #{args.shift}"
|
1000
1003
|
when String; where_clause = args.shift
|
1004
|
+
when Hash
|
1005
|
+
where_clause = args.shift.map { |k,v|
|
1006
|
+
"#{self.quote_identifier(k)} = #{self.quote_value(v) }"
|
1007
|
+
}.join(" and ")
|
1001
1008
|
when Symbol; fields << args.shift
|
1002
1009
|
when Array; fields = args.shift
|
1003
1010
|
when nil; where_clause = "true"
|