====== Tabli - Data Update Command ======
===== About =====
''data update'' is a [[docs:tabli:tabli|Tabli]] [[docs:tabli:command|command]] that supports the [[docs:op:update|update data operation]] where the data to [[docs:op:update|update]] are defined in a [[docs:flow:source|source data resource]].
This is an alias command of the [[transfer|data transfer command]] where the ''transfer-operation'' [[docs:tabli:option|option]] has been set to ''update''.
===== Prerequisites =====
* The [[docs:flow:source|source]] should have data for the [[docs:flow:target|target]] primary key column or a unique column
* The [[docs:flow:target|target]] should have a primary key column or a unique column
===== Syntax =====
tabli data update -h
Tabli data update
=================
Update one or more data resources with other data resources.
Note: This is an alias command to the `transfer` command with the `update` transfer operation.
Examples
--------
1 - To update the result of the Sql query `query_11.sql` into the Sql table `analytics`, you would execute
tabli data update (query_11.sql)@sqlite analytics@sqlite
2 - To update the file `foo.csv` into the `sqlite` table `foo`, you would execute
tabli data update foo.csv foo@sqlite
Syntax
------
tabli data update [options|flags]
where:
Arguments:
A data selector that select the data resources to transfer
A target data URI that defines the destination (Example: [table]@connection). If the target data uri has no name, the name will be the name of the source.
Cross Data Transfer Options:
-bs,--buffer-size defines the size of the memory buffer between the source and target threads
-mdu,--metrics-data-uri defines a target data uri where the data metrics should be exported
-sfs,--source-fetch-size defines the fetch size against the source connection
-tbs,--target-batch-size defines the batch size against the target data resource
-tcf,--target-commit-frequency defines the commit frequency in number of batches against the target data resource
-tw,--target-worker defines the target number of thread against the target connection
-wbv,--with-bind-variables defines if bind variables are used in the SQL statement
Data Definition Options:
-sa,--source-attribute Set a source data resource attribute
-ta,--target-attribute Set a target data resource attribute
Transfer Operation Options:
-so,--source-operation defines the data operation (drop or truncate) on the source after transfer. Note: A `move` operation will drop the source.
-to,--target-operation defines the data operations (replace, truncate) on the existing target before transfer.
Selection Options:
-wd,--with-dependencies If set, the dependencies will be also selected
Global Options:
-cf,--conf The path to a configuration file
-cv,--connection-vault The path where the connection vault is located
-h,--help Print this help
-l,--log-level Set the log level
-ns,--not-strict A minor error will not stop the process.
-odu,--output-data-uri defines the output data uri for the feedback data (default: console)
-oo,--output-operation defines the data operations (replace, truncate) on an existing output resource before transfer.
-oop,--output-transfer-operation defines the output transfer operation (insert, update, merge, copy). Default to `copy` for a file system and `insert` for a database.
-pp,--passphrase A passphrase (master password) to decrypt the encrypted values