table_saw 1.1.0 → 1.2.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: 33d3ff20492080ac1eb74a93466aa8c1d2b6f52b192b1b9fee8744a1755e6e2c
4
- data.tar.gz: c1f5f2908a7b1f894e56696da3a3d37efb28ad9567527dc65ec57a7991506c11
3
+ metadata.gz: 119c0e1c6d21c1469f5435050f41016c4a1941b620e449f41eee3efa9343e80b
4
+ data.tar.gz: 73cb265c0056f59c1b37954d8a02a8ea3b5c547ba09848ff1774c041d5d7cb3b
5
5
  SHA512:
6
- metadata.gz: 260d2f1af458bc4ed939a647e206cd1bb9cab56211ea1031e2abb5c002fa0e22981b497d6f6a350207d540f5be522600ae2f1b87cc880476b136ffb05219497f
7
- data.tar.gz: a0e4e17955719d75410b173c8a85052d036c434fb0c88da3a1cdd623a75c7b3fca3eaa2c9e1f756f3ffa8440151eb2d94b9c9a5d9e2facbeeb036b98b3f19a76
6
+ metadata.gz: 58e97f00198b0b28b4ae19169f419bed764b82e6d82458f29686b24b270bce5f168b6b5cb5753279d57d1e1373c5254b1eb02b86df96eca7db4adc1567558d9b
7
+ data.tar.gz: c4c55b312df315ccf8937aed578711140d468f899019616571131e948cddf5791ac4e473ca95828fa3be906306f16150a696226b877e1ded6281a93aee47ec27
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- table_saw (1.1.0)
4
+ table_saw (1.2.0)
5
5
  connection_pool
6
6
  pg
7
7
  thor
data/exe/table-saw CHANGED
@@ -24,6 +24,7 @@ class CLI < Thor
24
24
  method_option :password, default: ENV['PGPASSWORD']
25
25
  method_option :manifest, aliases: '-m', required: true
26
26
  method_option :output, aliases: '-o', default: 'output.dump'
27
+ method_option :pool
27
28
  def dump
28
29
  TableSaw.configure(options.to_hash)
29
30
  records = TableSaw::DependencyGraph::Build.new(TableSaw::Manifest.instance).call
@@ -2,12 +2,16 @@
2
2
 
3
3
  module TableSaw
4
4
  class Configuration
5
- attr_accessor :dbname, :host, :port, :user, :password, :manifest, :output
5
+ attr_accessor :dbname, :host, :port, :user, :password, :manifest, :output, :pool
6
6
 
7
7
  def connection
8
8
  { dbname: dbname, host: host, port: port, user: user, password: password }
9
9
  end
10
10
 
11
+ def pool_size
12
+ (pool || 2).to_i
13
+ end
14
+
11
15
  def url=(value)
12
16
  URI.parse(value).tap do |uri|
13
17
  self.dbname = uri.path[1..-1]
@@ -12,7 +12,9 @@ module TableSaw
12
12
  end
13
13
 
14
14
  def self.pool
15
- @pool ||= ConnectionPool.new(size: 2) { PG::Connection.new(TableSaw.configuration.connection) }
15
+ @pool ||= ConnectionPool.new(size: TableSaw.configuration.pool_size) do
16
+ PG::Connection.new(TableSaw.configuration.connection)
17
+ end
16
18
  end
17
19
 
18
20
  def self.exec(sql)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableSaw
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_saw
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hamed Asghari
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-30 00:00:00.000000000 Z
11
+ date: 2019-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool