Results of 1 - 10 of about 57 for target (0.002 sec.)
- EXPORT and IMPORT DATABASE Statements 13011
- The EXPORT DATABASE command allows you to export the contents of the database to a specific directory. The IMPORT DATABASE command allows you to then read the contents again. Examples Export the database to the target directory target_direc
...tory as CSV files: EXPORT DATABASE 'target_directory'; Export to directory target_directory , using the given options for the CSV serialization: EXPORT DATABASE 'tar...get_directory' (FORMAT csv, DELIMITER '|'); Export to directory target_directory , tables serialized as Parquet: EXPORT DATABASE 'target_directory' (FORMAT parquet); Export to directory target_...directory , tables serialized as Parquet, compressed with Zstd, with a ROW_GROUP_SIZE of 100,000: EXPORT DATABASE 'target_directory' ( FORMAT parquet, COMPRESSION zstd, ROW_GROUP_SIZE 100_000 ); Reload the database again: IMPORT DATABASE 'sourc... - https://man.mtool.work/duckdb/2.0/sql/statements/export.html
- Merge Statement for SCD Type 2 11983
- This is a practical, step-by-step guide to using DuckDB's MERGE statement (introduced in v1.4.0) to perform upserts and build Slowly Changing Dimension Type 2 (SCD Type 2) tables . Type 2 SCDs let you keep full historical versions of record
...n Parquet, CSV, databases, thanks to DuckDB's connectivity! Prerequisites Basic SQL knowledge Key Terminology Term Meaning Target table The main/master table you are updating (e.g., master_ducks ) Source table The incoming/new data (e.g., incoming_duck...s ) MERGE INTO Specifies the target table USING Specifies the source table/query ON Join condition (usually primary/business key + current flag) WHEN MATCHED...Row exists in both → typically UPDATE (or DELETE) WHEN NOT MATCHED BY TARGET New row (insert) WHEN NOT MATCHED BY SOURCE Row disappeared → soft-delete/expire old version RETURNING merge_action Option... - https://man.mtool.work/duckdb/2.0/guides/sql_features/merge.html
- MERGE INTO Statement 11293
- The MERGE INTO statement is an alternative to INSERT INTO ... ON CONFLICT that doesn't need a primary key since it allows for a custom match condition. This is a very useful alternative for upserting use cases ( INSERT + UPDATE ) when the d
...oesn't meet a condition. For example, if we expect that data that is not present on the source shouldn't be present in the target: CREATE TABLE target AS SELECT unnest([1,2]) AS id; MERGE INTO target USING (SELECT 1 AS id) source USING (id) WHEN MATCHE...TURNING merge_action, *; merge_action id UPDATE 1 DELETE 2 There is also the possibility of specifying WHEN NOT MATCHED BY TARGET . However, the behavior is, as you may expect, the same as WHEN NOT MATCHED since by default when specifying conditions, w...e look at the target. Multiple Matching Source Rows A MERGE INTO statement may not affect the same target row more than once. If a target row m... - https://man.mtool.work/duckdb/2.0/sql/statements/merge_into.html
- UPDATE Statement 10015
- The UPDATE statement modifies the values of rows in a table. Examples For every row where i is NULL , set the value to 0 instead: UPDATE tbl SET i = 0 WHERE i IS NULL; Set all values of i to 1 and all values of j to 2: UPDATE tbl SET i = 1,
...E original.key = new.key ); SELECT * FROM original; key value 1 new value 2 new value 2 Multiple Matching Source Rows If a target row matches multiple rows in the FROM clause, the target row is updated only once, using the values of one of the matching...rows. Which source row is used is not specified. For example, the following query sets v to either 10 or 20 : CREATE TABLE target (id INTEGER, v INTEGER); INSERT INTO target VALUES (1, 0); CREATE TABLE source (id INTEGER, v INTEGER); INSERT INTO source...VALUES (1, 10), (1, 20); UPDATE target SET v = source.v FROM source WHERE target.id = source.id; To get deterministic results, ensure that each target row matche... - https://man.mtool.work/duckdb/2.0/sql/statements/update.html
- Struct Functions 9736
- The functions on this page work on STRUCT values . Functions that access entries by position, such as struct[idx] , struct_extract_at , struct_contains , struct_position and struct_values , also accept TUPLE values , i.e., structs with unna
...x] Bracket notation that serves as an alias for struct_extract from TUPLE s, using an index (1-based). remap_struct(input, target_type, mapping, defaults) Remap a STRUCT , LIST , or MAP value into the shape given by the type of target_type , renaming a...truct_extract from TUPLE s, using an index (1-based). | | Example | (row(42, 84))[1] | | Result | 42 | remap_struct(input, target_type, mapping, defaults) | Description | Remap an input value of type STRUCT , LIST , or MAP into the shape declared by th...e type of target_type , renaming and reordering fields, descending into nested types, and filling target fields that have no source counter... - https://man.mtool.work/duckdb/2.0/sql/functions/struct.html
- CREATE TRIGGER Statement 9692
- New The CREATE TRIGGER feature was introduced in DuckDB 2.0. The CREATE TRIGGER statement registers a trigger: a set of SQL statements that run automatically in response to INSERT , UPDATE , or DELETE events on a table. Examples Record ever
...REFERENCING OLD TABLE and NEW TABLE clauses expose the rows before and after the change as transition tables: CREATE TABLE target (id INTEGER, val INTEGER); CREATE TABLE audit (id INTEGER, old_val INTEGER, new_val INTEGER); CREATE TRIGGER trg_audit AFT...ER UPDATE ON target REFERENCING OLD TABLE AS o NEW TABLE AS n FOR EACH STATEMENT INSERT INTO audit SELECT n.id, o.val, n.val FROM o JOIN n ON...o.id = n.id; INSERT INTO target VALUES (1, 10), (2, 20); UPDATE target SET val = val * 10 WHERE id <= 2; SELECT * FROM audit; id old_val new_val 1 10 100... - https://man.mtool.work/duckdb/2.0/sql/statements/create_trigger.html
- Release Cycle 8825
- This document outlines the DuckDB and core extension release cycle framework. It is intended for developers working on DuckDB extensions to better understand the underlying processes. Overview DuckDB follows Semantic Versioning ( v<MAJOR>.<
...e in the active release cycle. Currently LTS releases will receive 1 year of support Unstable API extension : An extension targeting the unstable extension API. This can be both the C++ API or the unstable C API. These extensions are not binary-compati...ble across multiple DuckDB versions Stable API extension : An extension targeting the stable C API of DuckDB. These extensions are binary-compatible across multiple DuckDB versions In-tree extensions :...ing last-minute bugs by disallowing feature merges. PRs into DuckDB Bug-fixes for vx.y.<z+1> are no longer allowed, should target vx.<y+1>.0 instead Bug-fixes for vx.<y+1>.0 are merged into vx.<y+1>-codename Features for vx.<y+1>.0 are no longer allowe... - https://man.mtool.work/duckdb/2.0/dev/release_cycle.html
- Union Type 8825
- A UNION type (not to be confused with the SQL UNION operator ) is a nested type capable of holding one of multiple “alternative” values, much like the union in C. The main difference is that these UNION types are tagged unions and thus alwa
...ontaining the type. Any UNION can also be implicitly cast to another UNION if the source UNION members are a subset of the target's (if the cast is unambiguous). UNION uses the member types' VARCHAR cast functions when casting to VARCHAR : SELECT u FRO...'t be implicitly cast to any of their member types in general, since the information in the other members not matching the target type would be “lost”. If you want to coerce a UNION into one of its members, you should use the union_extract function exp...ne of the UNION member types. If there are multiple candidates, the built in implicit casting priority rules determine the target type. For example, a FLOAT → UNION(i INTEGER, v VARCHAR) cast will always cast the FLOAT to the INTEGER member before VARC... - https://man.mtool.work/duckdb/2.0/sql/data_types/union.html
- INSERT Statement 8561
- The INSERT statement inserts new data into a table. Examples Insert the values 1, 2, 3 into tbl : INSERT INTO tbl VALUES (1), (2), (3); Insert the result of a query into a table: INSERT INTO tbl SELECT * FROM other_tbl; Insert values into t
...ehavior: INSERT INTO tbl BY POSITION VALUES (5, 42); To use a different order, column names can be provided as part of the target, for example: CREATE TABLE tbl (a INTEGER, b INTEGER); INSERT INTO tbl (b, a) VALUES (5, 42); Adding BY POSITION results i...j = EXCLUDED.j; Warning When a single INSERT statement contains multiple to-be-inserted rows that share the same conflict target, DuckDB applies only one update per conflicting key, and the row that wins is not guaranteed to be the last one in inserti...Y (id1, id2)); INSERT OR REPLACE INTO t1 VALUES (1, 2, 3); INSERT OR REPLACE INTO t1 VALUES (1, 2, 4); Defining a Conflict Target A conflict target may be provided as ON CONFLICT (conflict_target) . This is a group of columns that an index or uniquenes... - https://man.mtool.work/duckdb/2.0/sql/statements/insert.html
- ADBC Client 8355
- Installation To use the DuckDB ADBC client, download the libduckdb archive for your platform and follow the instructions below . For Python, install the duckdb package instead, as described in the Python section . The latest stable version
...a statement. (AdbcStatement*, const char*, const char*, AdbcError*) StatementSetOption(&adbc_statement, ADBC_INGEST_OPTION_TARGET_TABLE, "TABLE_NAME", &adbc_error) Functions related to query execution: Function name Description Arguments Example Statem...s the number of rows affected through its rows_affected output parameter. Ingestion Options Option Description adbc.ingest.target_table The target table name for ingestion. adbc.ingest.target_catalog The target catalog (attached database) for ingestion.... When set without adbc.ingest.target_db_schema , the schema defaults to main . adbc.ingest.target_db_schema The target schema for ingestion. adbc.ingest.tempor... - https://man.mtool.work/duckdb/2.0/clients/adbc.html
DuckDB 2.0 Documentation / man.mtool.work