class
Runcobo::Tasks::Database
- Runcobo::Tasks::Database
- Reference
- Object
Defined in:
tasks/database.crConstant Summary
-
CONNECTION_OVERRIDES =
["PGHOST", "PGHOSTADDR", "PGPORT", "PGDATABASE", "PGSERVICE", "PGSERVICEFILE", "PGOPTIONS", "MYSQL_HOST", "MYSQL_TCP_PORT", "MYSQL_UNIX_PORT"] of ::String -
DEPLOYMENT_KINDS =
["staging", "production"] of ::String -
DEPLOYMENT_OPTIONS =
SAFE_OPTIONS + (["sslrootcert", "sslcert", "sslkey", "sslcrl", "target_session_attrs"] of ::String) -
LOCAL_KINDS =
["development", "test"] of ::String -
MYSQL_TLS_MODES =
["true", "false", "skip-verify", "preferred"] of ::String -
SAFE_OPTIONS =
["application_name", "connect_timeout", "sslmode"] of ::String
Constructors
Class Method Summary
Instance Method Summary
- #connection_environment(environment = ENV.to_h) : Hash(String, String)
- #console(kind : String)
- #database_name(kind : String) : String
- #database_url(kind : String, environment = ENV.to_h) : String
- #default_database_url(kind : String) : String
- #engine : Engine
- #ensure_database(kind : String) : String
- #local : Path
- #migrate(kind : String, options = Migrations::Options.new)
- #migration_database_url(kind : String, operation : String, environment = ENV.to_h) : String
-
#mysql(url : String, source : String | Nil = nil, *, database : Bool = true, command = "mysql", extra : Array(String) = [] of String, capture : Bool = true, input : Process::Stdio = Process::Redirect::Close) : Result
Runs the MySQL client against a server from a URL.
- #prepare(kind : String)
- #psql(url : String, source : String | Nil = nil, *, capture : Bool = true) : Result
- #rollback(kind : String, options = Migrations::Options.new)
- #runner : Runner
- #seed(kind : String)
- #settings : Config
-
#sqlite_path(url : String) : Path
The database file of a SQLite URL, resolved from the project root.
- #status(kind : String, options = Migrations::Options.new)
- #wait(kind : String, options = Migrations::Options.new)
Constructor Detail
Class Method Detail
Instance Method Detail
def migration_database_url(kind : String, operation : String, environment = ENV.to_h) : String
#
def mysql(url : String, source : String | Nil = nil, *, database : Bool = true, command = "mysql", extra : Array(String) = [] of String, capture : Bool = true, input : Process::Stdio = Process::Redirect::Close) : Result
#
Runs the MySQL client against a server from a URL. The password, if any, is passed in a private option file rather than on the command line.
def sqlite_path(url : String) : Path
#
The database file of a SQLite URL, resolved from the project root.