Skip to main content

Module dbshell

Module dbshell 

Source
Expand description

manage dbshell — spawn psql / mysql / sqlite3 for the current DATABASE_URL. manage dbshell: open the native CLI client for the current DATABASE_URL.

The URL scheme picks the client, and the process is replaced with exec() on Unix so Ctrl-C reaches the child.

The client itself must already be installed: psql for PostgreSQL, mysql for MySQL and MariaDB, sqlite3 for SQLite. If it is not on PATH, the verb says so.

Enums§

DbTarget
What the parser found in DATABASE_URL, split into the parts each client needs.

Functions§

command_for
Build the call for target as (program, args, env_vars).
parse_target
Parse a DATABASE_URL into a DbTarget.
run
Start the right CLI for url and hand the process over to it. On success this never returns. Unix uses exec(); other targets run the child and pass its exit code on.