gadget 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gadget/version.rb +1 -1
- data/lib/gadget.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a24920c2e0dfbd4e9be5d21f3cbb358028612402
|
4
|
+
data.tar.gz: a7add1ba201f2f2084e445255f395ebc0b8ade54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41656df40068edc50de39fdad9dcc099be8179cc5a028618a03b8047d75f3abcf599aac8fed2105f89386e20213b54430df14ff864f7295e1bf9ebc568a4f863
|
7
|
+
data.tar.gz: 6ffc8664913c5a759e5580cc01226a4f1ccd87d257498740c10d094165baa1f8ca52cbc195a466a6e75f41e181374e8ac7c907b405ccc5530f097abf86b2a8cf
|
data/lib/gadget/version.rb
CHANGED
data/lib/gadget.rb
CHANGED
@@ -28,14 +28,14 @@ SELECT t.tablename, a.attname
|
|
28
28
|
FROM pg_attribute a
|
29
29
|
INNER JOIN pg_class c ON a.attrelid=c.oid
|
30
30
|
INNER JOIN pg_tables t ON c.relname=t.tablename
|
31
|
+
WHERE a.attnum >= 0
|
31
32
|
END_OF_SQL
|
32
33
|
if tablename.nil?
|
33
34
|
rs = conn.exec(sql)
|
34
35
|
else
|
35
|
-
sql += "
|
36
|
+
sql += " AND t.tablename=$1"
|
36
37
|
rs = conn.exec_params(sql, [ tablename ])
|
37
38
|
end
|
38
|
-
# tuples = rs.map { | row | row }
|
39
39
|
tuples = rs.reduce({}) { | h, row | h[row['tablename']] ||= { :columns => [] }; h[row['tablename']][:columns] << row['attname']; h }
|
40
40
|
rs.clear
|
41
41
|
tuples
|