From 9671489fcf3fbb47be047a86f1de9e95af6c8e81 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 29 Apr 2017 21:46:08 +0200 Subject: DBShell::PostgresClient: Add `.runshell()` Add a method to execute the `psql` command. --- lib/dbshell/postgres_client.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/dbshell/postgres_client.rb b/lib/dbshell/postgres_client.rb index b77e681..1c1c663 100644 --- a/lib/dbshell/postgres_client.rb +++ b/lib/dbshell/postgres_client.rb @@ -1,6 +1,11 @@ class DBShell::PostgresClient EXECUTABLE_NAME = 'psql' + def self.runshell(db_info) + args = self.build_command(db_info) + exec(*args) + end + def self.build_command(db_info) args = [EXECUTABLE_NAME] -- cgit v1.2.3