gadget 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: f6feadef1150080b07735c8d7d83516d87bceea9
4
- data.tar.gz: 9c74000e08c87120b794c6871f8126198c9d248b
3
+ metadata.gz: a24920c2e0dfbd4e9be5d21f3cbb358028612402
4
+ data.tar.gz: a7add1ba201f2f2084e445255f395ebc0b8ade54
5
5
  SHA512:
6
- metadata.gz: e0ce84932a8c25607920db5a7111e8a3e37c70fc4eb6c486c467d0b7fd488246f880a0853e9bc226f100f750db631197f5ae7290fb1d266fcba30df01f8e7985
7
- data.tar.gz: 1a6fc7958a2c250af87035cb7619270db989462a02c052b6db2e9bfd1ec3fd12fefe7154415bf6150e9cd511848dd0816f4c49fdafafd8b7a4aad2cd75dd5326
6
+ metadata.gz: 41656df40068edc50de39fdad9dcc099be8179cc5a028618a03b8047d75f3abcf599aac8fed2105f89386e20213b54430df14ff864f7295e1bf9ebc568a4f863
7
+ data.tar.gz: 6ffc8664913c5a759e5580cc01226a4f1ccd87d257498740c10d094165baa1f8ca52cbc195a466a6e75f41e181374e8ac7c907b405ccc5530f097abf86b2a8cf
@@ -1,3 +1,3 @@
1
1
  module Gadget
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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 += " WHERE t.tablename=$1"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gadget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig S. Cottingham