|
| 1 | +# Command-Line Help for `butane` |
| 2 | + |
| 3 | +This document contains the help content for the `butane` command-line program. |
| 4 | + |
| 5 | +**Command Overview:** |
| 6 | + |
| 7 | +* [`butane`↴](#butane) |
| 8 | +* [`butane init`↴](#butane-init) |
| 9 | +* [`butane backend`↴](#butane-backend) |
| 10 | +* [`butane backend add`↴](#butane-backend-add) |
| 11 | +* [`butane backend remove`↴](#butane-backend-remove) |
| 12 | +* [`butane backend list`↴](#butane-backend-list) |
| 13 | +* [`butane make-migration`↴](#butane-make-migration) |
| 14 | +* [`butane detach-migration`↴](#butane-detach-migration) |
| 15 | +* [`butane migrate`↴](#butane-migrate) |
| 16 | +* [`butane regenerate`↴](#butane-regenerate) |
| 17 | +* [`butane describe-migration`↴](#butane-describe-migration) |
| 18 | +* [`butane list`↴](#butane-list) |
| 19 | +* [`butane collapse`↴](#butane-collapse) |
| 20 | +* [`butane embed`↴](#butane-embed) |
| 21 | +* [`butane unmigrate`↴](#butane-unmigrate) |
| 22 | +* [`butane clear`↴](#butane-clear) |
| 23 | +* [`butane clear data`↴](#butane-clear-data) |
| 24 | +* [`butane delete`↴](#butane-delete) |
| 25 | +* [`butane delete table`↴](#butane-delete-table) |
| 26 | +* [`butane clean`↴](#butane-clean) |
| 27 | + |
| 28 | +## `butane` |
| 29 | + |
| 30 | +Manages butane database migrations. |
| 31 | + |
| 32 | +**Usage:** `butane [OPTIONS] <COMMAND>` |
| 33 | + |
| 34 | +###### **Subcommands:** |
| 35 | + |
| 36 | +* `init` — Initialize the database |
| 37 | +* `backend` — Backends |
| 38 | +* `make-migration` — Create a new migration |
| 39 | +* `detach-migration` — Detach the latest migration |
| 40 | +* `migrate` — Apply migrations |
| 41 | +* `regenerate` — Regenerate migrations in place |
| 42 | +* `describe-migration` — |
| 43 | +* `list` — List migrations |
| 44 | +* `collapse` — Replace all migrations with a single migration representing the current model state |
| 45 | +* `embed` — Embed migrations in the source code |
| 46 | +* `unmigrate` — Undo migrations. With no arguments, undoes the latest migration. If the name of a migration is specified, rolls back until that migration is the latest applied migration |
| 47 | +* `clear` — Clear |
| 48 | +* `delete` — Delete |
| 49 | +* `clean` — Clean current migration state. Deletes the current migration working state which is generated on each build. This can be used as a workaround to remove stale tables from the schema, as Butane does not currently auto-detect model removals. The next build will recreate with only tables for the extant models |
| 50 | + |
| 51 | +###### **Options:** |
| 52 | + |
| 53 | +* `-v`, `--verbose` — Increase logging verbosity |
| 54 | +* `-q`, `--quiet` — Decrease logging verbosity |
| 55 | +* `-p`, `--path <PATH>` |
| 56 | + |
| 57 | + Default value: `<detected project containing .butane directory>` |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +## `butane init` |
| 62 | + |
| 63 | +Initialize the database |
| 64 | + |
| 65 | +**Usage:** `butane init [OPTIONS] <BACKEND> <CONNECTION>` |
| 66 | + |
| 67 | +###### **Arguments:** |
| 68 | + |
| 69 | +* `<BACKEND>` — Database connection string. Format depends on backend |
| 70 | +* `<CONNECTION>` — Database backend to use. 'sqlite' or 'pg' |
| 71 | + |
| 72 | +###### **Options:** |
| 73 | + |
| 74 | +* `--no-connect` — Do not connect to the database |
| 75 | + |
| 76 | + Possible values: `true`, `false` |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +## `butane backend` |
| 82 | + |
| 83 | +Backends |
| 84 | + |
| 85 | +**Usage:** `butane backend <COMMAND>` |
| 86 | + |
| 87 | +###### **Subcommands:** |
| 88 | + |
| 89 | +* `add` — Add a backend to existing migrations |
| 90 | +* `remove` — Remove a backend from existing migrations |
| 91 | +* `list` — List backends present in existing migrations |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +## `butane backend add` |
| 96 | + |
| 97 | +Add a backend to existing migrations |
| 98 | + |
| 99 | +**Usage:** `butane backend add <NAME>` |
| 100 | + |
| 101 | +###### **Arguments:** |
| 102 | + |
| 103 | +* `<NAME>` — Backend name to add |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +## `butane backend remove` |
| 108 | + |
| 109 | +Remove a backend from existing migrations |
| 110 | + |
| 111 | +**Usage:** `butane backend remove <NAME>` |
| 112 | + |
| 113 | +###### **Arguments:** |
| 114 | + |
| 115 | +* `<NAME>` — Backend name to remove |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +## `butane backend list` |
| 120 | + |
| 121 | +List backends present in existing migrations |
| 122 | + |
| 123 | +**Usage:** `butane backend list` |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | +## `butane make-migration` |
| 128 | + |
| 129 | +Create a new migration |
| 130 | + |
| 131 | +**Usage:** `butane make-migration <NAME>` |
| 132 | + |
| 133 | +###### **Arguments:** |
| 134 | + |
| 135 | +* `<NAME>` — Name to use for the migration |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | +## `butane detach-migration` |
| 140 | + |
| 141 | +Detach the latest migration |
| 142 | + |
| 143 | +**Usage:** `butane detach-migration` |
| 144 | + |
| 145 | +This command removes the latest migration from the list of migrations and sets butane state to before the latest migration was created. |
| 146 | + |
| 147 | +The removed migration is not deleted from file system. |
| 148 | + |
| 149 | +This operation is the first step of the process of rebasing a migration onto other migrations that have the same original migration. |
| 150 | + |
| 151 | +If the migration has not been manually edited, it can be automatically regenerated after being rebased. In this case, deleting the detached migration is often the best approach. |
| 152 | + |
| 153 | +However if the migration has been manually edited, it will need to be manually re-attached to the target migration series after the rebase has been completed. |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | +## `butane migrate` |
| 159 | + |
| 160 | +Apply migrations |
| 161 | + |
| 162 | +**Usage:** `butane migrate [NAME]` |
| 163 | + |
| 164 | +###### **Arguments:** |
| 165 | + |
| 166 | +* `<NAME>` — Migration to migrate to |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | +## `butane regenerate` |
| 171 | + |
| 172 | +Regenerate migrations in place |
| 173 | + |
| 174 | +**Usage:** `butane regenerate` |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | +## `butane describe-migration` |
| 179 | + |
| 180 | +**Usage:** `butane describe-migration <NAME>` |
| 181 | + |
| 182 | +###### **Arguments:** |
| 183 | + |
| 184 | +* `<NAME>` — Name of migration to be described, or `current` |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | +## `butane list` |
| 189 | + |
| 190 | +List migrations |
| 191 | + |
| 192 | +**Usage:** `butane list` |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | +## `butane collapse` |
| 197 | + |
| 198 | +Replace all migrations with a single migration representing the current model state |
| 199 | + |
| 200 | +**Usage:** `butane collapse <NAME>` |
| 201 | + |
| 202 | +###### **Arguments:** |
| 203 | + |
| 204 | +* `<NAME>` — Name to use for the new migration |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | +## `butane embed` |
| 209 | + |
| 210 | +Embed migrations in the source code |
| 211 | + |
| 212 | +**Usage:** `butane embed` |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | +## `butane unmigrate` |
| 217 | + |
| 218 | +Undo migrations. With no arguments, undoes the latest migration. If the name of a migration is specified, rolls back until that migration is the latest applied migration |
| 219 | + |
| 220 | +**Usage:** `butane unmigrate [NAME]` |
| 221 | + |
| 222 | +###### **Arguments:** |
| 223 | + |
| 224 | +* `<NAME>` — Migration to roll back to |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | +## `butane clear` |
| 229 | + |
| 230 | +Clear |
| 231 | + |
| 232 | +**Usage:** `butane clear <COMMAND>` |
| 233 | + |
| 234 | +###### **Subcommands:** |
| 235 | + |
| 236 | +* `data` — Clear all data from the database. The schema is left intact, but all instances of all models (i.e. all rows of all tables defined by the models) are deleted |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | +## `butane clear data` |
| 241 | + |
| 242 | +Clear all data from the database. The schema is left intact, but all instances of all models (i.e. all rows of all tables defined by the models) are deleted |
| 243 | + |
| 244 | +**Usage:** `butane clear data` |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | +## `butane delete` |
| 249 | + |
| 250 | +Delete |
| 251 | + |
| 252 | +**Usage:** `butane delete <COMMAND>` |
| 253 | + |
| 254 | +###### **Subcommands:** |
| 255 | + |
| 256 | +* `table` — Clear all data from the database. The schema is left intact, but all instances of all models (i.e. all rows of all tables defined by the models) are deleted |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | +## `butane delete table` |
| 261 | + |
| 262 | +Clear all data from the database. The schema is left intact, but all instances of all models (i.e. all rows of all tables defined by the models) are deleted |
| 263 | + |
| 264 | +**Usage:** `butane delete table <NAME>` |
| 265 | + |
| 266 | +###### **Arguments:** |
| 267 | + |
| 268 | +* `<NAME>` — Table name |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | +## `butane clean` |
| 273 | + |
| 274 | +Clean current migration state. Deletes the current migration working state which is generated on each build. This can be used as a workaround to remove stale tables from the schema, as Butane does not currently auto-detect model removals. The next build will recreate with only tables for the extant models |
| 275 | + |
| 276 | +**Usage:** `butane clean` |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | +<hr/> |
| 281 | + |
| 282 | +<small><i> |
| 283 | + This document was generated automatically by |
| 284 | + <a href="https://crates.io/crates/clap-markdown"><code>clap-markdown</code></a>. |
| 285 | +</i></small> |
| 286 | + |
0 commit comments