Our great sponsors
-
bqb
BQB is a lightweight and easy to use query builder that works with sqlite, mysql, mariadb, postgres, and others.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I totally understand this. If you do go with a query builder, may I recommend bqb (shameless plug) as it allows you to remain closer to the SQL than some alternatives and doesn't do anything fancy. We stripped out 50% of our query logic with it in our org, which has enabled us to more readily tweak the SQL for performance.
Another choice is a library like squirrel which helps with building SQL statements, adding parameters, and execution. Such libraries tend to be a bit memory hungry though. I have benchmarked some libraries against each other awhile back here https://github.com/nofeaturesonlybugs/sqlhbenchmarks If you look at the benchmarks involving squirrel you can see it tends to make many more allocations than the alternatives I tested.