Skip to content

Commit 6cfd6e1

Browse files
committed
Get rid of psqldef's PGSSLMODE workaround
You can use psqldef v0.11.41 or newer instead.
1 parent eb3bc1a commit 6cfd6e1

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/sqldef.rb

+3-12
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ module Sqldef
2424
]
2525
private_constant :COMMANDS
2626

27-
ENVS = {
28-
'psqldef' => { 'PGSSLMODE' => 'disable' }, # TODO: support updating this
29-
}
30-
private_constant :ENVS
31-
3227
@bin = Dir.pwd
3328

3429
class << self
@@ -40,7 +35,7 @@ def export(command:, path:, host:, port: nil, user:, password: nil, database:)
4035
sqldef = download(command)
4136
schema = IO.popen(
4237
[
43-
env(command), sqldef,
38+
sqldef,
4439
"--user=#{user}", *(["--password=#{password}"] if password),
4540
"--host=#{host}", *(["--port=#{port}"] if port),
4641
'--export', database,
@@ -56,7 +51,7 @@ def export(command:, path:, host:, port: nil, user:, password: nil, database:)
5651
def dry_run(command:, path:, host:, port: nil, user:, password: nil, database:)
5752
sqldef = download(command)
5853
execute(
59-
env(command), sqldef,
54+
sqldef,
6055
"--user=#{user}", *(["--password=#{password}"] if password),
6156
"--host=#{host}", *(["--port=#{port}"] if port),
6257
'--dry-run', database,
@@ -69,7 +64,7 @@ def dry_run(command:, path:, host:, port: nil, user:, password: nil, database:)
6964
def apply(command:, path:, host:, port: nil, user:, password: nil, database:)
7065
sqldef = download(command)
7166
execute(
72-
env(command), sqldef,
67+
sqldef,
7368
"--user=#{user}", *(["--password=#{password}"] if password),
7469
"--host=#{host}", *(["--port=#{port}"] if port),
7570
database,
@@ -109,10 +104,6 @@ def execute(*cmd, **opts)
109104
end
110105
end
111106

112-
def env(command)
113-
ENVS.fetch(command.to_s, {})
114-
end
115-
116107
def build_url(command)
117108
unless COMMANDS.include?(command)
118109
raise "Unexpected sqldef command: #{command}"

0 commit comments

Comments
 (0)