Hi everyone! I'm working on a small to medium forum project that requires smooth database swapping capabilities. Personally, I'm not a fan of ORMs because of their performance issues, and I'm comfortable with writing SQL directly. I've been looking into SQLAlchemy Core, but unfortunately, the documentation is quite overwhelming and I'm struggling to wrap my head around it. I've also tried PyPika, which has a clean and concise API that's easy to use and helps with translating queries across different SQL dialects. Are there any other SQL builders or tools you would recommend? Thanks for your help!
5 Answers
If you're looking for ease of use, PyPika shines with its simple syntax. SQLAlchemy is more robust when working at scale, so it really comes down to what your primary priorities are.
SQLAlchemy is an essential tool in the Python ecosystem. Sure, the learning curve might seem daunting, but if you're focusing on raw SQL, it gets much easier. You might find that knowing SQL helps you navigate it better in the long run, especially for anything beyond just hobby projects.
Consider SQLModel as it integrates nicely with FastAPI and allows for a lot of functionality with fewer lines of code, if that’s something that interests you.
You might want to look into sqlglot or even narwhals. I know sqlglot is quite useful for translating SQL queries. If you're after low-level control, it could be worth your time.
Honestly, just commit to learning SQLAlchemy; the performance concerns some have are often due to careless coding practices like n+1 queries — issues that can pop up in any framework. It’s really more about how you use it than the tool itself!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically