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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54c5bb0e7a737257f4270bb013a2e29140ede972ef5cf586431eb8bb0d23b09e
4
- data.tar.gz: bee04b0a4b23e709c4f9211f89bac792efb7906248242ab8898a8cab18a35fe4
3
+ metadata.gz: f0e237fa54bd35fcea22ba6ececa815375fed3a4a24e8e631ed6e532b963d9ca
4
+ data.tar.gz: 86baa5669aeeb8fa6b35e287008ee5aa8380f2cd596a75987b2b0a2313d16133
5
5
  SHA512:
6
- metadata.gz: 6c5e34db8bf2ed57bc4f82cfcc6b6165dcdd3185b7a222e1b4b5cf768b8f937bb8398005a1e5bf12b8891bfef27b5ec0e930893a343a15749976386a625c12ea
7
- data.tar.gz: 10bc6159532d7bd5a7d18bb14d1e4f453c833a5a9a52f479c04dc85fc24823a864367bfba49fb96908a356ed69bcd74d4024726dc0a7e836f35d3a2c3638ab6e
6
+ metadata.gz: 5dcac340c0b07bc17c1a3c0d80d6cc3e13bc9f703d8c3f1c661cbb633180241fb988b36dc547398197250a20ba9b0833bd4956fb16696a1e816a509f4da10ba5
7
+ data.tar.gz: 7dab233031f8cdb9334e66db65922ef186bef5cf2f5aefdf99f52e11808ae1255eb3c48a203b086fb00eecb82813452d6944abbb7fefbc50029b15f49f843eb2
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /Gemfile.lock
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## v0.2.0
2
+
3
+ - Use `PGSSLMODE=disable` for psqldef for now
4
+
5
+ ## v0.1.0
6
+
7
+ - Initial release
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}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sqldef
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.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