@@ -48,6 +48,11 @@ struct product {
4848// using price = tagged_column_field<price_tag, double>;
4949// price price_ ;
5050// // IMPORTANT: tag structs must be nested inside the table struct — not at global scope.
51+ //
52+ // // For wrapper types with default template parameters, use the provided aliases:
53+ // struct amount_tag {};
54+ // using amount = tagged_column_field<amount_tag, decimal_type_default>;
55+ // amount amount_ ;
5156
5257// c) Fixed string literal — column name embedded directly, no tag needed.
5358// ⚠ Two tables with identically-named and -typed columns share the same C++ type,
@@ -259,16 +264,27 @@ auto r2 = db.validate_database<my_db>();
259264``` cpp
260265struct event {
261266 COLUMN_FIELD(id, uint32_t)
262- COLUMN_FIELD(created_at, datetime_type) // DATETIME — defaults to NOW()
263- COLUMN_FIELD(updated_at, timestamp_type) // TIMESTAMP — defaults to NOW()
264- COLUMN_FIELD(duration, time_type) // TIME
265- COLUMN_FIELD(started_at, std::optional<datetime_type>) // nullable DATETIME
267+ COLUMN_FIELD(created_at, datetime_type<> ) // DATETIME — defaults to NOW()
268+ COLUMN_FIELD(updated_at, timestamp_type<> ) // TIMESTAMP — defaults to NOW()
269+ COLUMN_FIELD(duration, time_type<> ) // TIME
270+ COLUMN_FIELD(started_at, std::optional<datetime_type<> >) // nullable DATETIME
266271};
267272
268273// Fractional-second precision (0–6) is set on the value object:
269274event row;
270- row.created_at_ = datetime_type{tp, 3}; // DATETIME(3)
271- row.duration_ = time_type{std::chrono::milliseconds{1500}, 3}; // TIME(3) = 00:00:01.500
275+ row.created_at_ = datetime_type<>{tp, 3}; // DATETIME(3)
276+ row.duration_ = time_type<>{std::chrono::milliseconds{1500}, 3}; // TIME(3) = 00:00:01.500
277+
278+ // Non-macro form with concise aliases:
279+ struct audit_event {
280+ struct created_at_tag {};
281+ using created_at = tagged_column_field<created_at_tag, datetime_type_default>;
282+ created_at created_at_ ;
283+
284+ struct amount_tag {};
285+ using amount = tagged_column_field<amount_tag, decimal_type_default>;
286+ amount amount_;
287+ };
272288```
273289
274290### Numeric Precision Overrides
0 commit comments