simple-sql 0.4.30 → 0.4.31

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: f3ce78fa1829594cb55b82e2fd67dbdb51f176abd9257cc43c5ed9ce3566b416
4
- data.tar.gz: bdd74494f958463a114b634277a800db5e69b04bbe4e61547d161d5993e1733d
3
+ metadata.gz: f10fbb016a81d94094c3429a8b553b0da428f40d509b96e523eb1ac79982fdbb
4
+ data.tar.gz: 1b691b4e59e0c7d34d5912dacf80c58240bb0ce3733e78741f5e932f8f1409c0
5
5
  SHA512:
6
- metadata.gz: e0bcacf132436f7766401c0079696cf89989374010f6d22fae9166cf0e4c38259b0201203a039ab52843a80177d8e63c85323c346dabe5b58232f8d21f9020c5
7
- data.tar.gz: 05b3aa753984ad7b873f7459ee38d85f484ad430b872a02c6a7fc7545e8a5edea24774a3c113d4aec9c0ffcddcf3d3cc05916400881c087de7efa8327c13d644
6
+ metadata.gz: 2d33441657dc0cf4565bb313045949ead6d5b1dd22c14058fe10558b48b83a12c6e0dcdac5991c4859c43ab553f9e6e3d4b9dfc9ef1ac5358dbabbd04cc90513
7
+ data.tar.gz: 14965623e2f4541e3862b950ce4b6439c2a219ac7be9ffe3b720cc3f73d09a9c5629908e29b85a8860835d7c21ca641b618d4f1aece8f1704391b62a47262933
@@ -3,6 +3,8 @@ module Simple
3
3
  module Formatting
4
4
  extend self
5
5
 
6
+ MAX_LENGTH = 500
7
+
6
8
  def format(sql, *args)
7
9
  sql = format_sql(sql)
8
10
 
@@ -10,7 +12,7 @@ module Simple
10
12
 
11
13
  args = args.map(&:inspect).join(", ")
12
14
  sql += " w/args: #{args}"
13
- sql = sql[0, 98] + "..." if sql.length > 100
15
+ sql = sql[0, (MAX_LENGTH - 3)] + "..." if sql.length > MAX_LENGTH
14
16
  sql
15
17
  end
16
18
 
@@ -83,8 +83,12 @@ module Simple
83
83
 
84
84
  public
85
85
 
86
+ def looked_up_pg_classes
87
+ @looked_up_pg_classes ||= Hash.new { |hsh, key| hsh[key] = _lookup_pg_class(key) }
88
+ end
89
+
86
90
  def lookup_pg_class(oid)
87
- @pg_classes ||= Hash.new { |hsh, key| hsh[key] = _lookup_pg_class(oid) }
91
+ looked_up_pg_classes[oid]
88
92
  end
89
93
 
90
94
  private
@@ -1,5 +1,5 @@
1
1
  module Simple
2
2
  module SQL
3
- VERSION = "0.4.30"
3
+ VERSION = "0.4.31"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.30
4
+ version: 0.4.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-12-27 00:00:00.000000000 Z
12
+ date: 2019-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pg_array_parser