Cmdlets for CockroachDB

Build 24.0.9060

Update-CockroachDB Cmdlet

Parameters   Output Objects  

Updates CockroachDB data.

Syntax

Update-CockroachDB [parameters]

Remarks

The Update-CockroachDB cmdlet allows you to use a syntax similar to SQL UPDATE statements to update CockroachDB data.

$conn = Connect-CockroachDB -User 'root' -Password 'root' -Server 'localhost' -Port '26257' -Database 'system'
Update-CockroachDB -Connection $conn -Table "`"defaultdb`".`"public`".Orders" -Columns @("ShipCity") -Values @("Raleigh") -Id "10261"
The Where parameter can also be used to specify the primary key of the table:
Update-CockroachDB -Connection $conn -Table "`"defaultdb`".`"public`".Orders" -Columns @("ShipCity") -Values @("Raleigh") -Where "Id = '10261'"
The primary key can also be passed to the cmdlet along the pipeline:
Select-CockroachDB -Connection $conn -Table "defaultdb"."public".Orders -Where "ShipCountry = 'USA'" | Update-CockroachDB -Columns @("ShipCountry") -Values @("USA 2")

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060