-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlpp11 code generator can be more powerful #477
Comments
Hi zhengminlai, Thanks for sharing. I am happy to learn that you enjoy the library, and the extensions to the code generator sound very interesting.
Thanks, |
|
DB utils class: Including utility methods like InsertRcd(), QueryRcdByWhereCond(), etc., can certainly simplify database operations by providing a higher-level interface for common tasks. These utility methods can encapsulate complex SQL queries and make the code more readable and maintainable. However, it's crucial to handle security and parameterization properly to prevent SQL injection vulnerabilities. |
Hi rbock, I have used sqlpp11 for about one year. Thanks to the powerful and amazing library, it does improve my coding efficiency and code safety a lot, running stable in production.
Nevertheless, I want to give some advice on the code generator to make it more powerful.
Based on my project, I have optimized the sqlpp code generator in the following ways:
Sharding db/tables has nothing different in fields but the suffix of the db/table names between two tables. Therefore, we can generate code overwriting the serializer of the table name:
users can set
orm::test_db_suffix::kSuffix
andorm::t_test_table_suffix::kSuffix
to specify the db suffix and table suffix.InsertRcd
,QueryRcdByWhereCond
,QueryRcdListByWhereCond
,QueryRcdListByWhereCondWithPaging
,QueryRcdTotalCntByWhereCond
,such as
InsertRcd
:After those code generated, the coding efficiency can be greately improved, I hope the features can be supported in the code generator to help more developers, especially the feature of supporting parsing sharding dbs/tables.
Best Regards.
The text was updated successfully, but these errors were encountered: