module Runcobo::Tasks::Command

Defined in:

tasks/command.cr

Constant Summary

DB_HELP = "Usage: cobo [--root PATH] db COMMAND [ENV] [options]\n\nDatabase commands:\n ensure [ENV] Create the selected database on its server if needed\n prepare [ENV] Run ensure, then apply pending migrations\n migrate [ENV] Apply pending migrations to an existing database\n status [ENV] Show applied, pending and missing migrations\n rollback [ENV] Roll back the most recent migration\n wait [ENV] Wait for the database server to become available\n seed [ENV] Run the configured seed command\n console [ENV] Open psql, mysql or sqlite3 on the selected local database\n verify Check rollback and replay in a temporary schema, database or file\n snapshot Export a read-only structure snapshot from migrations using the test database\n\nThe engine (postgresql, mysql or sqlite) comes from sqlc.yaml.\nENV defaults to development. All commands with ENV accept development or test.\nmigrate, status, rollback and wait also accept staging. Use STAGING_DATABASE_URL.\nmigrate, status and wait also accept production. Use PRODUCTION_DATABASE_URL.\nverify and snapshot always use test.\nLocal databases live on a server you run (a file for SQLite).\nUse prepare to create a local database and migrate it.\nUse migrate when the database already exists. It does not create the database.\nRun seed separately to load seed data.\nstatus and console connect to an existing database without preparing it.\nRun cobo db migrate --help (or rollback, status, wait) for dbmate options."
HELP = "Set up a project created by crystal init app:\n init [--database postgresql|mysql|sqlite|none]\nProject commands (configured in runcobo.yml):\n dev Prepare the database, then build, run and rebuild on changes\n db ensure|prepare|seed|console [development|test]\n db migrate|status|wait [development|test|staging|production]\n db rollback [development|test|staging]\n db verify Verify dbmate rollback and replay in the test database\n db snapshot Export a read-only structure reference from migrations\n db --help Show database commands and environment options\n task list List project tasks\n task run NAME [-- arguments...] Run a configured project task\n test [--prepare] [arguments...] Run Crystal specs with the local test database settings\n runner FILE [-- arguments...] Run a Crystal script in the development environment\n console Open an interactive Crystal development console\n generate Generate typed queries with crsql\n generate --check Compare generated queries without rewriting project files\n crsql [arguments...] Run the bundled development generator\n crsql-build Build the development generator without generating queries\nOptions: --root PATH Use another project directory"

Class Method Summary

Class Method Detail

def self.run(arguments : Array(String), root = Path[Dir.current]) #

[View source]