table_saw 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/table-saw +1 -0
- data/lib/table_saw/configuration.rb +5 -1
- data/lib/table_saw/connection.rb +3 -1
- data/lib/table_saw/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 119c0e1c6d21c1469f5435050f41016c4a1941b620e449f41eee3efa9343e80b
|
4
|
+
data.tar.gz: 73cb265c0056f59c1b37954d8a02a8ea3b5c547ba09848ff1774c041d5d7cb3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58e97f00198b0b28b4ae19169f419bed764b82e6d82458f29686b24b270bce5f168b6b5cb5753279d57d1e1373c5254b1eb02b86df96eca7db4adc1567558d9b
|
7
|
+
data.tar.gz: c4c55b312df315ccf8937aed578711140d468f899019616571131e948cddf5791ac4e473ca95828fa3be906306f16150a696226b877e1ded6281a93aee47ec27
|
data/Gemfile.lock
CHANGED
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]
|
data/lib/table_saw/connection.rb
CHANGED
@@ -12,7 +12,9 @@ module TableSaw
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.pool
|
15
|
-
@pool ||= ConnectionPool.new(size:
|
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)
|
data/lib/table_saw/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|