ulib/3party/sqlpp11/docs/Remove.md
tqcq 99c258107b
All checks were successful
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Successful in 1m24s
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Successful in 1m30s
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Successful in 1m43s
linux-mips64-gcc / linux-gcc-mips64el (push) Successful in 1m47s
linux-x64-gcc / linux-gcc (push) Successful in 2m11s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Successful in 3m19s
linux-hisiv500-gcc / linux-gcc-hisiv500 (push) Successful in 3m39s
feat/support_orm (#2)
Co-authored-by: tqcq <99722391+tqcq@users.noreply.github.com>
Reviewed-on: #2
2024-01-06 13:56:45 +00:00

688 B

Since delete is keyword in C++ that has a different meaning than delete in SQL, sqlpp11 calls the method remove. There is no detailed documentation available yet, but here is an example that might help if you have read about select statements already:

db(remove_from(tab).where(tab.alpha == tab.alpha + 3));

Removing using multiple tables as condition:

test_sqlpp::Users usr;
test_sqlpp::UsersForms usr_forms;
test_sqlpp::Forms form_;

db(remove_from(usr_forms).using_(usr, form_, usr_forms).where( 
    usr_forms.iduser == usr.id 
    and usr.username == username 
    and usr_forms.idform == form_.id
    and form_.name == form_name
    ));