You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add sql_default() sentinel, positional and column-specific insert APIs
Introduce sql_default_t/sql_default() for emitting DEFAULT in INSERT
statements. Columns with auto_increment or default_value attributes can
be constructed from or assigned sql_default(). Add two new insert paths:
positional field-based (.values(sql_default(), col{"val"}, ...)) and
column-specific (.columns(col1{}, col2{}).values(v1, v2)). Both support
on_duplicate_key_update. Generalize upsert builder to work with all
insert paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
-`sql_default()` sentinel and `sql_default_t` type — represents the SQL `DEFAULT` keyword in INSERT statements
14
+
- Positional field-based insert — `insert_into(t{}).values(sql_default(), col2{"val"}, col3{"val"})` allows specifying all struct fields in order with `sql_default()` as a placeholder for columns that should use their database default
15
+
- Column-specific insert — `insert_into(t{}).columns(col1{}, col2{}).values(val1, val2)` allows inserting a subset of columns; column list is instance-based (no template arguments needed)
16
+
- Column field `sql_default()` assignability — columns with `auto_increment` or `default_value` attributes can be constructed from or assigned `sql_default()`: `row.id_ = sql_default()`, then the struct-based `insert_into(t{}).values(row)` emits `DEFAULT` for those columns
13
17
-`prepared_statement` — RAII wrapper for MySQL prepared statements (`MYSQL_STMT*`); created via `mysql_connection::prepare(sql)` or `prepare(builder)`; supports type-safe parameter binding via `execute(params...)` and typed result fetching via `query<RowType>(params...)`
14
18
-`transaction_guard` — RAII scoped transaction helper; `transaction_guard::begin(conn)` disables autocommit, destructor auto-rolls-back unless `commit()` is called; also provides explicit `rollback()`
15
19
- CTE fluent API — `with(cte("name", query)).select(...).from(cte_ref{"name"})` and `with(recursive(cte("name", sql))).select(...)` replace the old `with_cte()`/`with_recursive_cte()` builders
0 commit comments