knemm apply [options] [claims...]
The command does the same as join
except that as a last step applies all changes to an
actual database schema. I.e. it applies generated SQL schema statements, representing a diff, on the database.
$ knemm apply -s my-app-state -d @pg:my-app Person_2.yaml Product_4.yaml
The command will apply given claims onto my-app-state
and then sync the database specified
by @pg:my-app
.
To associate a given state with a particular database, use the connect command.
Most options for join also are valid for apply
. Here are the apply
specific ones:
Short form | Long form | Explanation |
---|---|---|
-d <db_spec> |
--database <db_spec> |
The database to sync with the state. dbspec docs. |
-Q |
--show-queries |
Show generated SQL queries (instead of executing them). |