Quantcast
Channel: Planet Plone - Where Developers And Integrators Write
Viewing all articles
Browse latest Browse all 3535

Wichert Akkerman: Sqlalchemy In Reverse

$
0
0

When using data in a relational database you often use an Object Relational Mapper (ORM) so you can pretend that you are only dealing with standard objects instead of having to deal with SQL directly. The ORM will then generate SQL automatically for you, and magically turn query results into objects again. For a recent project I had to do the exact reverse: turn a SQL expression into a SQLAlchemy construct.

Doing this required building a parser for SQL expressions to generate a syntax tree, and then converting the syntax tree into a SQLAlchemy expression.

Read entire article.


Viewing all articles
Browse latest Browse all 3535

Trending Articles