Built-in Commands

Below are the subcommands which come with WuttaSync.

It is fairly simple to add more; see Custom Commands.

wutta export-csv

Export data from the Wutta app database to CSV file(s).

This should be able to automatically export any table mapped in the app model. The only caveat is that it is “dumb” and does not have any special field handling. This means the column headers in the CSV will be the same as in the source table, and some data types may not behave as expected etc.

Defined in: wuttasync.cli.export_csv

                                                                                
 Usage: wutta export-csv [OPTIONS] [models]...                                  
                                                                                
 Export data from Wutta DB to CSV file(s)                                       
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│   models      <str>  Target model(s) to process.  Specify one or more, or    │
│                      omit to process default models.                         │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --list-models     -l                         List available target models    │
│                                              and exit.                       │
│ --create              --no-create            Allow new target records to be  │
│                                              created.  See aso --max-create. │
│                                              [default: create]               │
│ --update              --no-update            Allow existing target records   │
│                                              to be updated.  See also        │
│                                              --max-update.                   │
│                                              [default: update]               │
│ --delete              --no-delete            Allow existing target records   │
│                                              to be deleted.  See also        │
│                                              --max-delete.                   │
│                                              [default: no-delete]            │
│ --fields                             <str>   List of fields to process.  See │
│                                              also --exclude and --key.       │
│ --exclude                            <str>   List of fields *not* to         │
│                                              process.  See also --fields.    │
│ --key,--keys                         <str>   List of fields to use as record │
│                                              key/identifier.  See also       │
│                                              --fields.                       │
│ --max-create                         <int>   Max number of target records to │
│                                              create (per model).  See also   │
│                                              --create.                       │
│ --max-update                         <int>   Max number of target records to │
│                                              update (per model).  See also   │
│                                              --update.                       │
│ --max-delete                         <int>   Max number of target records to │
│                                              delete (per model).  See also   │
│                                              --delete.                       │
│ --max-total                          <int>   Max number of *any* target      │
│                                              record changes which may occur  │
│                                              (per model).                    │
│ --warn            -W                         Expect no changes; warn (email  │
│                                              the diff) if any occur.         │
│ --recip,--recips                     <str>   Override the recipient(s) for   │
│                                              diff warning email.             │
│ --max-diffs                          <int>   Max number of record diffs to   │
│                                              show (per model) in warning     │
│                                              email.                          │
│                                              [default: 15]                   │
│ --dry-run                                    Go through the motions, but     │
│                                              rollback the transaction.       │
│ --output          -o                 <path>  Path to output folder.  Or full │
│                                              path to output file if only     │
│                                              running one target model.       │
│ --help                                       Show this message and exit.     │
╰──────────────────────────────────────────────────────────────────────────────╯

wutta export-wutta

Export data to another Wutta app database, from the local one.

Defined in: wuttasync.cli.export_wutta

                                                                                
 Usage: wutta export-wutta [OPTIONS] [models]...                                
                                                                                
 Export data to another Wutta DB                                                
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│   models      <str>  Target model(s) to process.  Specify one or more, or    │
│                      omit to process default models.                         │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --list-models     -l                        List available target models and │
│                                             exit.                            │
│ --create              --no-create           Allow new target records to be   │
│                                             created.  See aso --max-create.  │
│                                             [default: create]                │
│ --update              --no-update           Allow existing target records to │
│                                             be updated.  See also            │
│                                             --max-update.                    │
│                                             [default: update]                │
│ --delete              --no-delete           Allow existing target records to │
│                                             be deleted.  See also            │
│                                             --max-delete.                    │
│                                             [default: no-delete]             │
│ --fields                             <str>  List of fields to process.  See  │
│                                             also --exclude and --key.        │
│ --exclude                            <str>  List of fields *not* to process. │
│                                             See also --fields.               │
│ --key,--keys                         <str>  List of fields to use as record  │
│                                             key/identifier.  See also        │
│                                             --fields.                        │
│ --max-create                         <int>  Max number of target records to  │
│                                             create (per model).  See also    │
│                                             --create.                        │
│ --max-update                         <int>  Max number of target records to  │
│                                             update (per model).  See also    │
│                                             --update.                        │
│ --max-delete                         <int>  Max number of target records to  │
│                                             delete (per model).  See also    │
│                                             --delete.                        │
│ --max-total                          <int>  Max number of *any* target       │
│                                             record changes which may occur   │
│                                             (per model).                     │
│ --warn            -W                        Expect no changes; warn (email   │
│                                             the diff) if any occur.          │
│ --recip,--recips                     <str>  Override the recipient(s) for    │
│                                             diff warning email.              │
│ --max-diffs                          <int>  Max number of record diffs to    │
│                                             show (per model) in warning      │
│                                             email.                           │
│                                             [default: 15]                    │
│ --dry-run                                   Go through the motions, but      │
│                                             rollback the transaction.        │
│ --dbkey                              <str>  Config key for app db engine to  │
│                                             be used as data target.          │
│ --help                                      Show this message and exit.      │
╰──────────────────────────────────────────────────────────────────────────────╯

wutta import-csv

Import data from CSV file(s) to the Wutta app database.

This should be able to automatically target any table mapped in the app model. The only caveat is that it is “dumb” and does not have any special field handling. This means the column headers in the CSV file must be named the same as in the target table, and some data types may not behave as expected etc.

Defined in: wuttasync.cli.import_csv

                                                                                
 Usage: wutta import-csv [OPTIONS] [models]...                                  
                                                                                
 Import data from CSV file(s) to Wutta DB                                       
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│   models      <str>  Target model(s) to process.  Specify one or more, or    │
│                      omit to process default models.                         │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --list-models     -l                         List available target models    │
│                                              and exit.                       │
│ --create              --no-create            Allow new target records to be  │
│                                              created.  See aso --max-create. │
│                                              [default: create]               │
│ --update              --no-update            Allow existing target records   │
│                                              to be updated.  See also        │
│                                              --max-update.                   │
│                                              [default: update]               │
│ --delete              --no-delete            Allow existing target records   │
│                                              to be deleted.  See also        │
│                                              --max-delete.                   │
│                                              [default: no-delete]            │
│ --fields                             <str>   List of fields to process.  See │
│                                              also --exclude and --key.       │
│ --exclude                            <str>   List of fields *not* to         │
│                                              process.  See also --fields.    │
│ --key,--keys                         <str>   List of fields to use as record │
│                                              key/identifier.  See also       │
│                                              --fields.                       │
│ --max-create                         <int>   Max number of target records to │
│                                              create (per model).  See also   │
│                                              --create.                       │
│ --max-update                         <int>   Max number of target records to │
│                                              update (per model).  See also   │
│                                              --update.                       │
│ --max-delete                         <int>   Max number of target records to │
│                                              delete (per model).  See also   │
│                                              --delete.                       │
│ --max-total                          <int>   Max number of *any* target      │
│                                              record changes which may occur  │
│                                              (per model).                    │
│ --warn            -W                         Expect no changes; warn (email  │
│                                              the diff) if any occur.         │
│ --recip,--recips                     <str>   Override the recipient(s) for   │
│                                              diff warning email.             │
│ --max-diffs                          <int>   Max number of record diffs to   │
│                                              show (per model) in warning     │
│                                              email.                          │
│                                              [default: 15]                   │
│ --dry-run                                    Go through the motions, but     │
│                                              rollback the transaction.       │
│ --input           -i                 <path>  Path to input folder.  Or full  │
│                                              path to input file if only      │
│                                              running one target model.       │
│ --help                                       Show this message and exit.     │
╰──────────────────────────────────────────────────────────────────────────────╯

wutta import-versions

Import latest data to version tables, for the Wutta app database.

The purpose of this is to ensure version tables accurately reflect the current “live” data set, for given table(s). It is only relevant/usable if versioning is configured and enabled. For more on that see Wutta-Continuum.

This command can check/update version tables for any versioned class in the app model.

Defined in: wuttasync.cli.import_versions

                                                                                
 Usage: wutta import-versions [OPTIONS] [models]...                             
                                                                                
 Import latest data to version tables, for Wutta DB                             
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│   models      <str>  Target model(s) to process.  Specify one or more, or    │
│                      omit to process default models.                         │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --list-models     -l                        List available target models and │
│                                             exit.                            │
│ --create              --no-create           Allow new target records to be   │
│                                             created.  See aso --max-create.  │
│                                             [default: create]                │
│ --update              --no-update           Allow existing target records to │
│                                             be updated.  See also            │
│                                             --max-update.                    │
│                                             [default: update]                │
│ --delete              --no-delete           Allow existing target records to │
│                                             be deleted.  See also            │
│                                             --max-delete.                    │
│                                             [default: no-delete]             │
│ --fields                             <str>  List of fields to process.  See  │
│                                             also --exclude and --key.        │
│ --exclude                            <str>  List of fields *not* to process. │
│                                             See also --fields.               │
│ --key,--keys                         <str>  List of fields to use as record  │
│                                             key/identifier.  See also        │
│                                             --fields.                        │
│ --max-create                         <int>  Max number of target records to  │
│                                             create (per model).  See also    │
│                                             --create.                        │
│ --max-update                         <int>  Max number of target records to  │
│                                             update (per model).  See also    │
│                                             --update.                        │
│ --max-delete                         <int>  Max number of target records to  │
│                                             delete (per model).  See also    │
│                                             --delete.                        │
│ --max-total                          <int>  Max number of *any* target       │
│                                             record changes which may occur   │
│                                             (per model).                     │
│ --warn            -W                        Expect no changes; warn (email   │
│                                             the diff) if any occur.          │
│ --recip,--recips                     <str>  Override the recipient(s) for    │
│                                             diff warning email.              │
│ --max-diffs                          <int>  Max number of record diffs to    │
│                                             show (per model) in warning      │
│                                             email.                           │
│                                             [default: 15]                    │
│ --dry-run                                   Go through the motions, but      │
│                                             rollback the transaction.        │
│ --help                                      Show this message and exit.      │
╰──────────────────────────────────────────────────────────────────────────────╯

wutta import-wutta

Import data from another Wutta app database, to the local one.

Defined in: wuttasync.cli.import_wutta

                                                                                
 Usage: wutta import-wutta [OPTIONS] [models]...                                
                                                                                
 Import data from another Wutta DB                                              
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│   models      <str>  Target model(s) to process.  Specify one or more, or    │
│                      omit to process default models.                         │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --list-models     -l                        List available target models and │
│                                             exit.                            │
│ --create              --no-create           Allow new target records to be   │
│                                             created.  See aso --max-create.  │
│                                             [default: create]                │
│ --update              --no-update           Allow existing target records to │
│                                             be updated.  See also            │
│                                             --max-update.                    │
│                                             [default: update]                │
│ --delete              --no-delete           Allow existing target records to │
│                                             be deleted.  See also            │
│                                             --max-delete.                    │
│                                             [default: no-delete]             │
│ --fields                             <str>  List of fields to process.  See  │
│                                             also --exclude and --key.        │
│ --exclude                            <str>  List of fields *not* to process. │
│                                             See also --fields.               │
│ --key,--keys                         <str>  List of fields to use as record  │
│                                             key/identifier.  See also        │
│                                             --fields.                        │
│ --max-create                         <int>  Max number of target records to  │
│                                             create (per model).  See also    │
│                                             --create.                        │
│ --max-update                         <int>  Max number of target records to  │
│                                             update (per model).  See also    │
│                                             --update.                        │
│ --max-delete                         <int>  Max number of target records to  │
│                                             delete (per model).  See also    │
│                                             --delete.                        │
│ --max-total                          <int>  Max number of *any* target       │
│                                             record changes which may occur   │
│                                             (per model).                     │
│ --warn            -W                        Expect no changes; warn (email   │
│                                             the diff) if any occur.          │
│ --recip,--recips                     <str>  Override the recipient(s) for    │
│                                             diff warning email.              │
│ --max-diffs                          <int>  Max number of record diffs to    │
│                                             show (per model) in warning      │
│                                             email.                           │
│                                             [default: 15]                    │
│ --dry-run                                   Go through the motions, but      │
│                                             rollback the transaction.        │
│ --dbkey                              <str>  Config key for app db engine to  │
│                                             be used as data source.          │
│ --help                                      Show this message and exit.      │
╰──────────────────────────────────────────────────────────────────────────────╯