From 27222dfe45c64c50c4469768480ce5183a085942 Mon Sep 17 00:00:00 2001 From: Mike Coutermarsh Date: Wed, 8 Nov 2023 15:51:46 -0500 Subject: [PATCH] support trilogy adapter --- lib/planetscale_rails/tasks/psdb.rake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/planetscale_rails/tasks/psdb.rake b/lib/planetscale_rails/tasks/psdb.rake index bd8bbb1..ec2f72a 100644 --- a/lib/planetscale_rails/tasks/psdb.rake +++ b/lib/planetscale_rails/tasks/psdb.rake @@ -79,7 +79,13 @@ namespace :psdb do password = response["plain_text"] ENV["PSCALE_PASSWORD_ID"] = response["id"] - "mysql2://#{username}:#{password}@#{host}:3306/#{database}" + adapter = "mysql2" + + if defined?(Trilogy) + adapter = "trilogy" + end + + "#{adapter}://#{username}:#{password}@#{host}:3306/#{database}?ssl_mode=VERIFY_IDENTITY" else puts "Failed to create credentials for PlanetScale #{db_branch_colorized(database, branch)}" puts "Command: #{command}"