Age | Commit message (Collapse) | Author |
|
Add a method to execute the `psql` command.
|
|
Instead of calling `DBShell::Sqlite3Client` directly, call the wrapper
class that will delegate to `Sqlite3Client`, `PostgresClient`, etc.
depending on the value of `adapter` in the database connection params
passed in.
This allows us to have a single interface that we can call from the Rake
task that can handle any of the database adapters that we support.
|
|
A more generic interface to specific database adapter clients. This
class will act as a frontend to the others.
Calling its `.runshell()` will call the appropriate `.runshell()` for
the adapter provided in `connection_params`.
This way, we have a single entry point to start a database shell from
the Rake `dbshell` task.
|
|
Remove our hard-coded "development" environment and instead get the
current environment dynamically via the `RAILS_ENV` environment
variable. Assume that the current environment is "development" if the
env variable is unset.
|
|
Add `DBShell::Sqlite3.runshell`, which takes database connection
information and starts a SQLite3 shell.
Currently the Rake task just calls the SQLite3 `.runshell` method
directly without any database adapter discrimination and also forces the
development environment. It's nice to see it working. Now, we'll need to
clean up those parts of the Rakefile.
|
|
Much simpler `.build_command` than the Postgres version. Only building
arguments now. Want to try out executing the subprocess command.
Inspired of course by:
https://github.com/django/django/blob/66150f7cf61bc09547fa98586790df596eff6d77/django/db/backends/sqlite3/client.py
|
|
Correctly builds the required arguments. Doesn't handle passwords at
all.
|
|
Match the expected type with the input.
|
|
Forgot to add an `it` block for my test, which resulted in it failing
with a non-obvious error message.
|
|
Make an empty container to pass the basic tests.
|
|
Thinking up an interface for generating command line arguments for the
`psql` command. Based on Django's dbshell:
https://github.com/django/django/blob/66150f7cf61bc09547fa98586790df596eff6d77/tests/dbshell/test_postgresql_psycopg2.py
|
|
Make it easier for us to run our specs.
|
|
Get rid of auto-generated double quotes in the `require` call.
|
|
|
|
Create a stub for our Rake task to see something working.
Inspired by
https://github.com/paulelliott/fabrication/blob/b470cd817e1973c14e3253cd76606cf934942ca1/lib/fabrication.rb
|
|
Use proper capitalisation for our module name.
|
|
Created from:
$ bundle gem dbshell-rails
|