@urban-toolkit/autk-db / UpdateTableParams
Interface: UpdateTableParams
Defined in: use-cases/update-table/interfaces.ts:25
Parameters for updating an existing DuckDB table with new data.
When using the 'update' strategy, idColumn is required and can reference a direct column (e.g. 'id') or a nested property (e.g. 'properties.building_id').
Examples
const params: UpdateTableParams = { tableName: 'places', data: geoJson, strategy: 'replace' };const params: UpdateTableParams = { tableName: 'buildings', data: geoJson, strategy: 'update', idColumn: 'properties.building_id' };Properties
data
data:
FeatureCollection<Geometry,GeoJsonProperties> |Record<string,unknown>[]
Defined in: use-cases/update-table/interfaces.ts:29
GeoJSON FeatureCollection for layer tables, or a plain object array for CSV/JSON tables.
idColumn?
optionalidColumn?:string
Defined in: use-cases/update-table/interfaces.ts:41
Required when strategy is 'update'.
Supports direct column names ('id') or nested property paths ('properties.building_id') that resolve to properties->>'building_id' in SQL.
strategy
strategy:
UpdateStrategy
Defined in: use-cases/update-table/interfaces.ts:35
Strategy for updating the table:
'replace': Drop and recreate the entire table with the new data.'update': Update existing records by ID (does not insert new records).
tableName
tableName:
string
Defined in: use-cases/update-table/interfaces.ts:27
Name of the table to update.
workspace?
optionalworkspace?:string
Defined in: use-cases/update-table/interfaces.ts:43
Workspace namespace used to qualify the table name. Defaults to the system workspace.