Sql constructor

28 views
Skip to first unread message

Nir Assaraf

unread,
Jun 6, 2023, 5:34:59 PM6/6/23
to sqlalchemy
Hey guys,

As a part of a project that I'm working on, Iv'e created a SQLAlchemy statement builder using the ast (abstract syntax trees) library.
This constructor will parse strings that are valid python logical statements and will convert them to the appropriate SQLAlchemy objects.

For example:
The constructor will take a string of the following format and a list of models/modelbase in which the columns exist.

string_a = '(column_a == 2 or column_b == 3) or column_c in [1,2,3]'    

and returns the SQLAlchemy objects that defines this logic and can be used in a query's where clause.

This was used to automate query building for a projects with thousands of different logics that where defined by the client.

I was just wondering if you think there is a place for something like that in SQLAlchemy or related projects.

Best regards,

Nir

Mike Bayer

unread,
Jun 8, 2023, 8:55:42 AM6/8/23
to noreply-spamdigest via sqlalchemy
we can't take on maintenance for new extensions within the SQLAlchemy project directly but I would encourage you to release your extension as its own library; see https://pypi.org/search/?q=sqlalchemy for other examples
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
 
 
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages