Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 958 Bytes

apply.md

File metadata and controls

30 lines (20 loc) · 958 Bytes

apply

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.

Example

$ 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.

Options

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).