4 ms·
I highly recommend pypika by Kayak: https://github.com/kayak/pypika https://github.com/kayak/pypika Have used in multiple projects and have found it's the righ
by bluehark 5y ago
I highly recommend pypika by Kayak:
https://github.com/kayak/pypika https://github.com/kayak/pypika
Have used in multiple projects and have found it's the right balance between ORMs and writing raw SQL. It's also easily extensible and takes care of the many edge cases and nuances of rolling your own SQL generator.
- orangepanda 5y ago> and takes care of the many edge cases and nuances of rolling your own SQL generator Want to elaborate?
- genericlemon24 5y agoFor one, it can output more than one flavor of SQL: https://pypika.readthedocs.io/en/latest/3_advanced.html#handling-different-database-platforms https://pypika.readthedocs.io/en/latest/3_advanced.html#hand... Since SQL is ever-so-slightly different across databases, I imagine trying to cover all of them as a single dev is a nightmare (especially if that's not the problem you're trying to solve). I wrote my own query builder because I know for sure I'm only targeting SQLite. The second I need my feed reader library to work with another database engine I'm dumping my own for something more serious – either a full blown database abstraction layer like SQLAlchemy or Peewee (likely without the ORM part), or something simpler like PyPika or python-sql.[1] [1]: I talk more about them here: https://death.andgravity.com/own-query-builder#sqlbuilder-pypika-python-sql https://death.andgravity.com/own-query-builder#sqlbuilder-py...
- genericlemon24 5y agoYup, after my own initial research I found it as well, and I like it a lot. I talk more about it here: https://death.andgravity.com/own-query-builder#sqlbuilder-pypika-python-sql https://death.andgravity.com/own-query-builder#sqlbuilder-py...