Skip to content

Commit fba3399

Browse files
committed
Document limitations of AppendDefault
1 parent 2e33f57 commit fba3399

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/duckdb/src/types/to_sql.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ use std::borrow::Cow;
88
/// default values (as defined in the table schema). Unlike `Null` which explicitly
99
/// sets a column to NULL, `AppendDefault` uses the column's DEFAULT expression.
1010
///
11+
/// ## Limitations
12+
///
13+
/// `AppendDefault` only works with **constant** default values. Non-deterministic
14+
/// defaults like `random()` or `nextval()` are not supported. Explicitly provide
15+
/// values for those columns as a workaround.
16+
///
1117
/// ## Example
1218
///
1319
/// ```rust,no_run
@@ -20,7 +26,7 @@ use std::borrow::Cow;
2026
/// )?;
2127
///
2228
/// let mut app = conn.appender("people")?;
23-
/// app.append_row(params![1, "Alice", AppendDefault])?;
29+
/// app.append_row(params![1, "Alice", AppendDefault])?; // status will be 'active'
2430
/// Ok(())
2531
/// }
2632
/// ```

0 commit comments

Comments
 (0)