{"id":15389322,"url":"https://github.com/tpluscode/dbup-diy-cli","last_synced_at":"2025-04-05T11:15:47.934Z","repository":{"id":82631257,"uuid":"78758733","full_name":"tpluscode/dbup-diy-cli","owner":"tpluscode","description":"Do-It-Yourself CommandLine Interface for DbUp","archived":false,"fork":false,"pushed_at":"2020-01-23T18:08:16.000Z","size":61,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T05:20:56.175Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpluscode.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-12T15:25:33.000Z","updated_at":"2019-11-23T17:35:34.000Z","dependencies_parsed_at":"2023-03-12T16:19:10.827Z","dependency_job_id":null,"html_url":"https://github.com/tpluscode/dbup-diy-cli","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpluscode%2Fdbup-diy-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpluscode%2Fdbup-diy-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpluscode%2Fdbup-diy-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpluscode%2Fdbup-diy-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpluscode","download_url":"https://codeload.github.com/tpluscode/dbup-diy-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325697,"owners_count":20920715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T15:00:01.611Z","updated_at":"2025-04-05T11:15:47.897Z","avatar_url":"https://github.com/tpluscode.png","language":"C#","readme":"# DbUp-DIY-CLI [![Build status][av-badge]][build] [![NuGet version][nuget-badge]][nuget-link]\n\nDo-It-Yourself CommandLine Interface for DbUp\n\n## Introduction\n\ndbup is a great library but requires some repeatable setup in code:\n\n1. Where are the scripts do run?\n1. Where is the destination database?\n1. How do I drop and recreate the database?\n1. Can I optionally run some seed data for developers/deployment?\n\n## Usage\n\n### Setup\n\n1. Create a Console project (like `ConsoleApplication1`)\n1. `Install-Package dbup-diy-cli`\n1. Add your SQL files as embedded resources        \n1. (optional) install db-specific package like `dbup-mysql`, `dbup-sqlite`, and change the etc\n1. Modify your `Main` and pass the appropriate method to `Run`:\n\n    ``` c#\n    public static int Main(string[] args)\n    {\n        return new DbUp.Cli.Upgrader(args).Run(MySqlExtensions.MySqlDatabase);\n    }\n    ```\n\n### Running\n    \nTo upgrade a local instance (uses Windows auth) run `ConsoleApplication1.exe local`\n    \n```\n-d, --database            Required. Database to upgrade\n\n-s, --server              Required. Server name/address\n\n--dev-seeds               Seed database with sample data\n\n-r, --recreate            Completely recreate all database objects\n\n-m, --mark-as-executed    Don't run ever run current migration scripts\n\n--dev-seed-pattern        (Default: _dev_) Regular expression to match and\n                          select developer seed script (case-insensitive)\n\n--run-always-pattern      (Default: sp_) Regular expression to match and\n                          scripts executed every time, such as stored\n                          procedures and functions (case-insensitive)\n                          \n-t, --timeout             Timeout for each script in seconds                          \n\n--help                    Display this help screen.\n\n--version                 Display version information.\n```\n\nTo upgrade an arbitrary server, use `ConsoleApplication1.exe remote`, with which you can provide a complete \nconnectionstring (`-c` switch) or a name to find in `app.config` (`-n` switch)\n\n```\n-c, --connection-string         connection string\n\n-n, --connection-string-name    connection string name\n\n--dev-seeds                     Seed database with sample data\n\n-r, --recreate                  Completely recreate all database objects\n\n-m, --mark-as-executed          Don't run ever run current migration scripts\n\n--dev-seed-pattern              (Default: _dev_) Regular expression to match\n                                and select developer seed script (case-insensitive)\n\n--run-always-pattern            (Default: sp_) Regular expression to match\n                                and scripts executed every time, such as\n                                stored procedures and functions (case-insensitive)\n                                \n-t, --timeout                   Timeout for each script in seconds                                \n\n--help                          Display this help screen.\n\n--version                       Display version information.\n```\n\n### Running Entity Framework code\n\nInstall `dbup-diy-cli.EntityFramework` package from NuGet and implement `EntityFrameworkScript\u003cT\u003e` or\n`EntityFrameworkUpdate\u003cT\u003e`. \n\nThe former can be used to return a script dynamically based on some EF query.\nThe latter is intended to be used to perform updates with Entity Framework.\n\n## Why not a ready-built CLI?\n\nThis way it's easier to use with database engines other that MS SQL, by installing `dbup-X` package together with \n`dbup-diy-cli`.\n\n[av-badge]: https://ci.appveyor.com/api/projects/status/hvhilv1f12n6dl52/branch/master?svg=true\n[build]: https://ci.appveyor.com/project/tpluscode78631/dbup-diy-cli/branch/master\n[nuget-badge]: https://badge.fury.io/nu/dbup-diy-cli.svg\n[nuget-link]: https://badge.fury.io/nu/dbup-diy-cli\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpluscode%2Fdbup-diy-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpluscode%2Fdbup-diy-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpluscode%2Fdbup-diy-cli/lists"}