Closed swuecho closed 3 years ago
Hey thanks!
Would this be the same as just needing a way to compile a query at runtime? Someone else brought that up. There's not a fantastic way to accomplish this now.
Maybe something like this sketch?
queries = pugsql.compile(path)
# later
queries.add('newquery', sql_string)
results = queries.newquery(**params)
add
is probably too generic of a name for it but that'd be the idea.
This is also helps. but sometimes, for example, I want to run query on each table. The param is the table_name, which sqlalchemy will add extra ''
. The query can not be run through pugsql. In situation like this, a connection is necessary.
if this is something can be considered, I am happy to make a pull request.
I was just looking for something like the add
above!
released in 0.2.2
make it convenient to get the engine, in case user need it to do some custom query.