datafusion 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/datafusion +13 -5
- data/lib/datafusion.rb +4 -0
- data/lib/datafusion/db_executor.rb +7 -0
- data/lib/datafusion/debug_executor.rb +5 -0
- data/lib/datafusion/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4065931f372c1c4d91ee61f462100b7c3c7ec7e7
|
4
|
+
data.tar.gz: e6e4f5c874d0e1972d7a81ec7ebb8d1997343f08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e9dd475618d1922e2273187b15e970a413df6129c637d0893a74ce260e15215fe998f1914db1021d27cad35416843342f4fcd2ea267a7801a59b8d928f37660
|
7
|
+
data.tar.gz: 6124e7695e338b00e6650fbdff8092c52281cc85f543ab457b0c4fb2c71c0890bb4047c4320b6d0a1168eb6979c4c300040edb5494883681e0ffc4e818ca8959
|
data/bin/datafusion
CHANGED
@@ -18,6 +18,7 @@ end
|
|
18
18
|
o = Slop::Options.new
|
19
19
|
o.string '-f', '--file', 'Integrations file (URL or local)'
|
20
20
|
o.string '-c', '--connection', 'Connection string to fusion engine (postgres)', default: 'postgres://localhost'
|
21
|
+
o.bool '-r', '--remove', 'Remove existing integrations', default: false
|
21
22
|
o.bool '-s', '--setup', 'Setup integrations', default: false
|
22
23
|
o.bool '-a', '--agent', 'Connection string (i.e postgres://localhost)', default: false
|
23
24
|
o.bool '-d', '--dryrun', 'dry run for refreshes', default: false
|
@@ -46,14 +47,21 @@ end
|
|
46
47
|
end
|
47
48
|
|
48
49
|
file = opts[:file]
|
50
|
+
|
49
51
|
|
50
|
-
if opts[:
|
51
|
-
Datafusion.fuse(file, exec_class, opts)
|
52
|
-
elsif opts[:agent]
|
52
|
+
if opts[:agent]
|
53
53
|
sched = Datafusion.refresh(file, exec_class, opts)
|
54
54
|
Datafusion.log.info("Running refresh agent.")
|
55
55
|
sched.join
|
56
|
-
else
|
57
|
-
bail("Please pick a mode: --setup | --agent", opts)
|
58
56
|
end
|
59
57
|
|
58
|
+
if opts[:remove]
|
59
|
+
Datafusion.remove!(exec_class)
|
60
|
+
Datafusion.log.info("Removed all integrations")
|
61
|
+
end
|
62
|
+
|
63
|
+
if opts[:setup]
|
64
|
+
Datafusion.fuse(file, exec_class, opts)
|
65
|
+
end
|
66
|
+
|
67
|
+
|
data/lib/datafusion.rb
CHANGED
@@ -8,6 +8,13 @@ module Datafusion
|
|
8
8
|
@db = Sequel.connect(conn)
|
9
9
|
end
|
10
10
|
|
11
|
+
def remove!
|
12
|
+
servers = @db[:pg_foreign_server].map(:srvname)
|
13
|
+
servers.each do |srv|
|
14
|
+
execute("drop server if exists #{srv} cascade", "drop #{srv}")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
11
18
|
def execute(sql, label='')
|
12
19
|
run = rand(36**5).to_s(36)
|
13
20
|
|
data/lib/datafusion/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datafusion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dotan Nahum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|