datapipe2 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fns/mssql_to_pgsql.rb +6 -6
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34805539a0453fa87d4388b6f0e555e8c269b383
|
4
|
+
data.tar.gz: 1b6f0108e659fcdc3b5e3aa4db6c02f3b8123c10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e186210ab40da293c3ff14b692a84120cb61afcc9fddee17d6299369e902760885eddb767c42f211f69d30d16ebebdb4b2f235b4cfe401124562531ff1ddcb9
|
7
|
+
data.tar.gz: b8c22a890d4c0d8a18c404b94cfb43a79fbaca29aac238bf4ac07dddb4d6add93bc42c09f7665a7e39d1ee387261015d944e01855e6c8c6aa62ea46ff4806ed0
|
data/lib/fns/mssql_to_pgsql.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
|
-
def mssql_to_pgsql(
|
3
|
-
s = FluidDb::Db(ENV[
|
4
|
-
d = FluidDb::Db(ENV[
|
2
|
+
def mssql_to_pgsql(select_sql, table_name, columns)
|
3
|
+
s = FluidDb::Db(ENV['MSSQL']) # source
|
4
|
+
d = FluidDb::Db(ENV['PGSQL']) # destination
|
5
5
|
|
6
|
-
d.connection.exec("TRUNCATE TABLE #{
|
6
|
+
d.connection.exec("TRUNCATE TABLE #{table_name}")
|
7
7
|
copy_cmd = %{
|
8
|
-
COPY #{
|
8
|
+
COPY #{table_name} (#{columns})
|
9
9
|
FROM STDIN
|
10
10
|
WITH DELIMITER AS '|'
|
11
11
|
CSV;"
|
@@ -21,5 +21,5 @@ def mssql_to_pgsql(mssql, pgsql, select_sql, tableName, columns)
|
|
21
21
|
end
|
22
22
|
d.connection.put_copy_end
|
23
23
|
|
24
|
-
DataPipe2.log "#{
|
24
|
+
DataPipe2.log "#{table_name}: #{count}"
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datapipe2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guy Irvine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -71,7 +71,8 @@ files:
|
|
71
71
|
- LICENSE
|
72
72
|
- README.md
|
73
73
|
homepage: http://rubygems.org/gems/datapipe2
|
74
|
-
licenses:
|
74
|
+
licenses:
|
75
|
+
- LGPL-3.0
|
75
76
|
metadata: {}
|
76
77
|
post_install_message:
|
77
78
|
rdoc_options: []
|