@@ -61,7 +61,7 @@ struct product {
6161// c) Fixed string literal — column name embedded directly, no tag needed.
6262// ⚠ Two tables with identically-named and -typed columns share the same C++ type,
6363// so column_field cannot verify which table a column belongs to. This means
64- // column_field columns cannot be used as select projections in from< Table >() .
64+ // from() cannot verify column membership for untagged column_field types .
6565// Prefer COLUMN_FIELD or explicit nested tags for query-building use cases.
6666// using price = column_field<"price", double>;
6767// price price_ ;
@@ -79,13 +79,13 @@ auto db = mysql_connection::connect(mysql_config{
7979}).value();
8080
8181// CREATE TABLE IF NOT EXISTS product (...)
82- db.execute(create_table< product >( ).if_not_exists());
82+ db.execute(create_table(product{} ).if_not_exists());
8383
8484// Type-safe SELECT: returns std::expected<std::vector<std::tuple<uint32_t, varchar_type<255>>>, std::string>
85- auto rows = db.query(select< product::id, product::name>( )
86- .from< product >( )
87- .where(product::price{ 9.99} )
88- .order_by< product::id > ( ));
85+ auto rows = db.query(select( product::id{} , product::name{} )
86+ .from(product{} )
87+ .where(equal < product::price > ( 9.99) )
88+ .order_by( product::id{} ));
8989
9090for (auto const& [ id, name] : * rows) {
9191 std::println("{}: {}", id, name.to_string());
@@ -201,15 +201,15 @@ auto db = mysql_connection::connect(cfg).value();
201201### DDL (CREATE, DROP)
202202
203203```cpp
204- db.execute(create_table<product>( ).if_not_exists());
205- db.execute(drop_table<product>( ));
206- db.execute(create_database<my_db>( ).if_not_exists());
204+ db.execute(create_table(product{} ).if_not_exists());
205+ db.execute(drop_table(product{} ));
206+ db.execute(create_database(my_db{} ).if_not_exists());
207207```
208208
209209#### CREATE TABLE attributes (fluent API)
210210
211211``` cpp
212- auto sql = create_table<product>( )
212+ auto sql = create_table(product{} )
213213 .if_not_exists()
214214 .engine(Engine::InnoDB)
215215 .auto_increment(1 )
@@ -218,8 +218,8 @@ auto sql = create_table<product>()
218218 .comment(" product catalog" )
219219 .build_sql();
220220
221- auto ctas = create_table<product_archive>( )
222- .as(select< product::id, product::name>( ).from<product>( ))
221+ auto ctas = create_table(product_archive{} )
222+ .as(select( product::id{} , product::name{} ).from(product{} ))
223223 .engine(" MyCustomEngine" )
224224 .default_charset(" koi8r" )
225225 .build_sql();
@@ -228,28 +228,28 @@ auto ctas = create_table<product_archive>()
228228### DML (INSERT, UPDATE, DELETE)
229229
230230``` cpp
231- db.execute(insert_into<product>( ).values(row));
232- db.execute(update<product>( ).set(product::price{12.99}).where(product::id{1} ));
233- db.execute(delete_from< product >( ).where(product::id{1} ));
234- db.execute(truncate< product >( ));
231+ db.execute(insert_into(product{} ).values(row));
232+ db.execute(update(product{} ).set(product::price{12.99}).where(equal < product::id > (1u) ));
233+ db.execute(delete_from(product{} ).where(equal < product::id > (1u) ));
234+ db.execute(truncate_table(product{} ));
235235```
236236
237237### DQL (SELECT, COUNT, DESCRIBE)
238238
239239```cpp
240240// Select specific columns
241- auto rows = db.query(select< product::id, product::name>( ).from<product>( ));
241+ auto rows = db.query(select( product::id{} , product::name{} ).from(product{} ));
242242
243243// Select all columns
244- auto all = db.query(select< product::id, product::sku, product::name, product::price>( )
245- .from<product>( )
246- .order_by< product::id>( ));
244+ auto all = db.query(select( product::id{} , product::sku{} , product::name{} , product::price{} )
245+ .from(product{} )
246+ .order_by( product::id{} ));
247247
248248// Count
249- auto cnt = db.query(count<product>( ).where(product::price{ 9.99} ));
249+ auto cnt = db.query(count(product{} ).where(equal< product::price>( 9.99) ));
250250
251251// DESCRIBE (schema introspection)
252- auto cols = db.query(describe<product>( ));
252+ auto cols = db.query(describe(product{} ));
253253```
254254
255255### Schema Validation
0 commit comments