sqldef 0.1.0 → 0.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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +7 -0
- data/lib/sqldef.rb +12 -3
- data/lib/sqldef/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0e237fa54bd35fcea22ba6ececa815375fed3a4a24e8e631ed6e532b963d9ca
|
4
|
+
data.tar.gz: 86baa5669aeeb8fa6b35e287008ee5aa8380f2cd596a75987b2b0a2313d16133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dcac340c0b07bc17c1a3c0d80d6cc3e13bc9f703d8c3f1c661cbb633180241fb988b36dc547398197250a20ba9b0833bd4956fb16696a1e816a509f4da10ba5
|
7
|
+
data.tar.gz: 7dab233031f8cdb9334e66db65922ef186bef5cf2f5aefdf99f52e11808ae1255eb3c48a203b086fb00eecb82813452d6944abbb7fefbc50029b15f49f843eb2
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
data/lib/sqldef.rb
CHANGED
@@ -24,6 +24,11 @@ module Sqldef
|
|
24
24
|
]
|
25
25
|
private_constant :COMMANDS
|
26
26
|
|
27
|
+
ENVS = {
|
28
|
+
'psqldef' => { 'PGSSLMODE' => 'disable' }, # TODO: support updating this
|
29
|
+
}
|
30
|
+
private_constant :ENVS
|
31
|
+
|
27
32
|
@bin = Dir.pwd
|
28
33
|
|
29
34
|
class << self
|
@@ -35,7 +40,7 @@ module Sqldef
|
|
35
40
|
sqldef = download(command)
|
36
41
|
schema = IO.popen(
|
37
42
|
[
|
38
|
-
sqldef,
|
43
|
+
env(command), sqldef,
|
39
44
|
"--user=#{user}", *(["--password=#{password}"] if password),
|
40
45
|
"--host=#{host}", *(["--port=#{port}"] if port),
|
41
46
|
'--export', database,
|
@@ -51,7 +56,7 @@ module Sqldef
|
|
51
56
|
def dry_run(command:, path:, host:, port: nil, user:, password: nil, database:)
|
52
57
|
sqldef = download(command)
|
53
58
|
execute(
|
54
|
-
sqldef,
|
59
|
+
env(command), sqldef,
|
55
60
|
"--user=#{user}", *(["--password=#{password}"] if password),
|
56
61
|
"--host=#{host}", *(["--port=#{port}"] if port),
|
57
62
|
'--dry-run', database,
|
@@ -64,7 +69,7 @@ module Sqldef
|
|
64
69
|
def apply(command:, path:, host:, port: nil, user:, password: nil, database:)
|
65
70
|
sqldef = download(command)
|
66
71
|
execute(
|
67
|
-
sqldef,
|
72
|
+
env(command), sqldef,
|
68
73
|
"--user=#{user}", *(["--password=#{password}"] if password),
|
69
74
|
"--host=#{host}", *(["--port=#{port}"] if port),
|
70
75
|
database,
|
@@ -104,6 +109,10 @@ module Sqldef
|
|
104
109
|
end
|
105
110
|
end
|
106
111
|
|
112
|
+
def env(command)
|
113
|
+
ENVS.fetch(command.to_s, {})
|
114
|
+
end
|
115
|
+
|
107
116
|
def build_url(command)
|
108
117
|
unless COMMANDS.include?(command)
|
109
118
|
raise "Unexpected sqldef command: #{command}"
|
data/lib/sqldef/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqldef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
@@ -19,6 +19,7 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- ".github/workflows/main.yml"
|
21
21
|
- ".gitignore"
|
22
|
+
- CHANGELOG.md
|
22
23
|
- Gemfile
|
23
24
|
- LICENSE.txt
|
24
25
|
- README.md
|