====== Tabli - Upsert (Update/Insert) a Connection ======
===== About =====
''upsert'' is an action of the [[docs:tabli:connection:start|connection module]] that update a [[docs:connection:connection|connection]] or create it if it doesn't exist yet in the [[docs:conf:vault|connection vault]].
===== Example =====
==== Modifying the connection URL ====
* [[add|Add a connection]]
tabli connection upsert --url "jdbc:sqlite://%TMP%/mySqliteDb.db" mySqliteDB
The connection (mySqliteDB) didn't exist and was created
The connection (mySqliteDB) was updated.
* Update the [[docs:connection:uri|URL attribute]]
tabli connection upsert --url "jdbc:sqlite://%TMP%/db.db" mySqliteDB
The connection (mySqliteDB) exist already.
The connection (mySqliteDB) was updated.
* With the [[info|info action]], we can see that the URL has changed
tabli connection info mySqliteDB
Information about the connection (mySqliteDB)
Attribute Value Description
---------------------- -------------------------------------------------------- --------------------------------------------------------------------
DatabaseMajorVersion 3 The major version number of the database
DatabaseMinorVersion 30 The minor version number of the database
DatabaseProductName SQLite The name of the database
DatabaseProductVersion 3.30.1 The version of the database
DriverName SQLite JDBC The driver name
DriverVersion 3.30.1 The driver version
JdbcMajorVersion 2 The major version number of JDBC
JdbcMinorVersion 1 The minor version number of JDBC
MaxConcurrentThread 1 The maximum number of threads that can be created against the system
MaxNameInPath 1 The maximum number of names in a path
Name mySqliteDB The name of the connection
SupportBatchUpdates true If the system supports batch SQL updates
SupportNamedParameters true If the system supports named parameters in the SQL statement
TabBooleanDataType Binary Boolean data type used to store boolean values
TabDateDataType SqlLiteral Date data type used to store date values
TabTimeDataType SqlLiteral Time format data type to store time values
TabTimestampDataType SqlLiteral Timestamp data type used to store timestamp values
Url jdbc:sqlite://C:\Users\GERARD~1\AppData\Local\Temp/db.db The url of the connection
===== Syntax =====
tabli connection upsert --help
Tabli connection upsert
=======================
Update or insert a connection
Example
-------
1 - To upsert the information of the connection called `db`
tabli connection upsert --url jdbc:sqlite//%TMP%/db.db db
Syntax
------
tabli connection upsert [options|flags]
where:
Arguments:
the connection name
Options:
-d,--driver The jdbc driver (for a jdbc connection)
-p,--password The user password
--url The connection url (if the connection doesn't exist, this options is mandatory)
-u,--user The login (ie user)
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