diff options
author | Teddy Wing | 2017-04-29 21:46:08 +0200 |
---|---|---|
committer | Teddy Wing | 2017-04-29 21:46:08 +0200 |
commit | 9671489fcf3fbb47be047a86f1de9e95af6c8e81 (patch) | |
tree | 1e4d6414925d03962ba783708a182eb85a3dd7c3 /lib | |
parent | f1c4164aef7ef88735a254e1301c3e4bf5978714 (diff) | |
download | dbshell-rails-9671489fcf3fbb47be047a86f1de9e95af6c8e81.tar.bz2 |
DBShell::PostgresClient: Add `.runshell()`
Add a method to execute the `psql` command.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dbshell/postgres_client.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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] |