[sqlalchemy] NestedType for clickhouse-sqlalchemy dialect

2019-01-24 Thread Антонио Антуан
Greetings. I want to implement NestedType for the dialect of ClickHouse database. At the first sight it looks like copmosite type, but not not completely: 1. Each

Re: [sqlalchemy] Re: jsonb_agg issue

2018-09-06 Thread Антонио Антуан
Ok, that works almost fine: >>> func.jsonb_agg(literal_column(models.OrderUINTable.name + '.*')) 'jsonb_agg(OrderUIN.*)' The problem is OrderUIN. It must be quoted: jsonb_agg("OrderUIN".*) чт, 6 сент. 2018 г. в 17:44, Антонио Антуан : > Another one

[sqlalchemy] Re: jsonb_agg issue

2018-09-06 Thread Антонио Антуан
Another one fail: func.jsonb_agg(*models.OrderUINTable.c.values()) - PG error: "function jsonb_agg(integer, text, numeric, text, text, text, text) does not exist" четверг, 6 сентября 2018 г., 17:28:37 UTC+3 пользователь Антонио Антуан написал: > > Hi guys. > I'm using sqla

[sqlalchemy] jsonb_agg issue

2018-09-06 Thread Антонио Антуан
Hi guys. I'm using sqlalchemy 1.1.13, want to construct that query: select o.*, jsonb_agg(ou.*) from "Orders" o left join "OrderUIN" ou on ou."OrderID" = o."OrderID" group by o."OrderID" I tried that options: - func.jsonb_agg(OrderUINTable), got select o.*, jsonb_agg() from "Orders"... Empty

[sqlalchemy] Queries comparison

2018-06-22 Thread Антонио Антуан
Hi there! I have a very complicated queries generator and I want to test it. Currently it looks like that: def test(): query = generate_query() compiled = compile_query(query) assert compiled == 'SELECT * FROM table' Problems begin when I add some filters to query: def test():

render impl for custom dialect

2018-05-18 Thread Антонио Антуан
Hi. I use [that](https://github.com/xzkostyan/clickhouse-sqlalchemy) library and tries to make migrations using alembic. Here is simple implementation for that dialect: ``` class ClickHOuseImpl(postgresql.PostgresqlImpl): __dialect__ = 'clickhouse' transactional_ddl = False ``` Here is

Re: [sqlalchemy] Redefine operator compilation for specific dialect

2018-04-19 Thread Антонио Антуан
Perfect, thanks чт, 19 апр. 2018 г., 20:17 Mike Bayer <mike...@zzzcomputing.com>: > On Thu, Apr 19, 2018 at 9:52 AM, Антонио Антуан <a.ch@gmail.com> > wrote: > > So, anyway, I must implement BitAnd class? Or I can check if 'element.op > == > > &' insid

Re: [sqlalchemy] Redefine operator compilation for specific dialect

2018-04-19 Thread Антонио Антуан
So, anyway, I must implement BitAnd class? Or I can check if 'element.op == &' inside compile function? чт, 19 апр. 2018 г., 16:31 Mike Bayer <mike...@zzzcomputing.com>: > On Thu, Apr 19, 2018 at 5:21 AM, Антонио Антуан <a.ch@gmail.com> > wrote: > > Hi guys. &g

[sqlalchemy] Redefine operator compilation for specific dialect

2018-04-19 Thread Антонио Антуан
Hi guys. Is there any mechanism in SQLAlchemy which allows to redefine operator compilation? I want to the same thing as already exists for functions. An example for functions: class IntDiv(GenericFunction): type = Integer package = 'adc_custom' name = 'div' identifier = 'div'

Re: [sqlalchemy] Emit INSERT query with float values reducing number of decimal digits

2018-03-05 Thread Антонио Антуан
You can specify column precision пн, 5 мар. 2018 г. в 18:42, Ruben Di Battista : > I have a table that is storing a huge amount of numerical details about my > application. I

Re: [sqlalchemy] pass additional kwargs to execute into BulkUD _do_exec method

2018-02-22 Thread Антонио Антуан
and checking for update and delete operation. Tracebacks included. вт, 13 февр. 2018 г. в 20:37, Антонио Антуан <a.ch@gmail.com>: > I understand. Excuse me, drown in work. Going to test your code in a > couple of days. > > вт, 13 февр. 2018 г., 20:32 Mike Bayer <mike...@zzzc

Re: [sqlalchemy] How right use session/scoped_session in web app?

2018-02-16 Thread Антонио Антуан
февраля 2018 г., 18:07:49 UTC+3 пользователь Антонио Антуан > написал: >> >> You need just that: >> from proj.core import Session >> >> @app.teardown_request >> def clear_session(): >> Session.remove() >> >> Session created with scoper_

Re: [sqlalchemy] How right use session/scoped_session in web app?

2018-02-15 Thread Антонио Антуан
You need just that: from proj.core import Session @app.teardown_request def clear_session(): Session.remove() Session created with scoper_session, of course. We do not use flask-sqlalchemy package, just flask and separated sqlalchemy. чт, 15 февр. 2018 г., 16:28 Simon King

Re: [sqlalchemy] pass additional kwargs to execute into BulkUD _do_exec method

2018-02-13 Thread Антонио Антуан
gt; > wrote: > > code review at https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/656 > > and ideally would include basic ShardedQuery support > > > > On Tue, Feb 6, 2018 at 7:23 PM, Mike Bayer <mike...@zzzcomputing.com> > wrote: > >> On Tue, F

[sqlalchemy] pass additional kwargs to execute into BulkUD _do_exec method

2018-02-06 Thread Антонио Антуан
Hello Mike! First of all, thank you for your help with this problem. Me and my crew appreciate it. I have a question in case of `identity_token` for `update` and `delete` methods of `Query` instances. If we take a look on

Re: [sqlalchemy] Re: Not able to filter json column filter in flask-sqlalchemy

2017-12-07 Thread Антонио Антуан
What is the version of your PostgreSQL? Here is an example. Works perfectly for me (pg9.6 and pg10). https://gist.github.com/aCLr/7d794eabbf972a60a15f40b2d3965508 чт, 7 дек. 2017 г. в 16:05, : > Hi, > > I tried using direct plain JSON: > > my model > class

Re: [sqlalchemy] Re: Not able to filter json column filter in flask-sqlalchemy

2017-12-07 Thread Антонио Антуан
you can call "->>" (and any other) operator directly: Student.data_test.op('->>')('foo') == 'bar' if you want to call cast use this: cast(Student.data_test['foo'], String) == 'bar' "c" (the shortcut for "columns") allows for "Table" instances. If you use declarative style, you can not to use it

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Антонио Антуан
чт, 23 нояб. 2017 г. в 20:27, Mike Bayer <mike...@zzzcomputing.com>: > On Thu, Nov 23, 2017 at 8:44 AM, Антонио Антуан <a.ch@gmail.com> > wrote: > > > >> A Query can have lots of entities in it, and if you're doing sharding a > >> single result set ca

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Антонио Антуан
See, that `Query.get` using `get_from_identity` instead of `instances` with key, constructed into `_get_impl`. Could you point to another places where same problem (described into my first message) can be appeared? чт, 23 нояб. 2017 г. в 16:44, Антонио Антуан <a.ch@gmail.com>: > &g

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Антонио Антуан
y key tuple, and it > >> would be pretty hard. The "easy" part is getting the mapper to set > >> itself up with some extra attributes that can deliver some kind of > >> supplemental value to the identity key. the harder part is then in > >> loa

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-22 Thread Антонио Антуан
t ever been requested > before. > > > > On Tue, Nov 21, 2017 at 10:12 AM, Mike Bayer <mike...@zzzcomputing.com> > wrote: > > On Tue, Nov 21, 2017 at 7:39 AM, Антонио Антуан <a.ch@gmail.com> > wrote: > >> Hi guys. > >> > >> I got th

[sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-21 Thread Антонио Антуан
Hi guys. I got this code example: https://gist.github.com/aCLr/ff9462b634031ee6bccbead8d913c41f. Here I make custom `Session` and custom `Query`. As you see, `Session` has several binds. Also, you can see that there are two functions: `assert_got_correct_objects_with_remove` and

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-26 Thread Антонио Антуан
Yes, it works. I'm grateful for your help :) ср, 25 окт. 2017 г. в 16:56, Mike Bayer <mike...@zzzcomputing.com>: > On Wed, Oct 25, 2017 at 9:25 AM, Антонио Антуан <a.ch@gmail.com> > wrote: > > As I said befire, sqlalchemy version: 1.0.19 and code is here: > >

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
pper. Otherwise I should pass "None" to "_connection_from_session()" as value of "mapper" argument" Am I right? ср, 25 окт. 2017 г. в 16:18, Mike Bayer <mike...@zzzcomputing.com>: > On Wed, Oct 25, 2017 at 6:52 AM, Антонио Антуан <a.ch@gmai

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
Looks like I have to check if _mapper_zero() returns real mapper. Otherwise I should pass None to "_connection_from_session()" as value of "mapper" argument. Right? ср, 25 окт. 2017 г. в 15:00, Антонио Антуан <a.ch@gmail.com>: > As I mentioned before, " grou

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
As I mentioned before, "". ср, 25 окт. 2017 г. в 14:19, Simon King <si...@simonking.org.uk>: > What does self._mapper_zero() return in your > RoutingQuery._execute_and_instances method? > > Simon > > On Wed, Oct 25, 2017 at 11:52 AM, Антонио Антуан <a.ch@

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
Any news here? суббота, 21 октября 2017 г., 18:42:47 UTC+3 пользователь Антонио Антуан написал: > > I see that it is not happened when "bind" passed directly to > "sessionmaker" > > сб, 21 окт. 2017 г. в 18:33, Антонио Антуан <a.ch@gmail.com>: >

Re: [sqlalchemy] custom compiler for GenericFunction

2017-10-23 Thread Антонио Антуан
Yes, it works. Thank you. пн, 23 окт. 2017 г. в 17:43, Mike Bayer <mike...@zzzcomputing.com>: > On Mon, Oct 23, 2017 at 6:40 AM, Антонио Антуан <a.ch@gmail.com> > wrote: > > Hello guys. > > > > I try to make my own GenericFunction with default compiler an

[sqlalchemy] custom compiler for GenericFunction

2017-10-23 Thread Антонио Антуан
Hello guys. I try to make my own GenericFunction with default compiler and custom compiler for particular dialect. As you see below, always used custom compiler: from sqlalchemy import func, create_engine, Integer from sqlalchemy.ext.compiler import compiles from sqlalchemy.orm import

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-21 Thread Антонио Антуан
I see that it is not happened when "bind" passed directly to "sessionmaker" сб, 21 окт. 2017 г. в 18:33, Антонио Антуан <a.ch@gmail.com>: > > > пятница, 20 октября 2017 г., 20:50:52 UTC+3 пользователь Mike Bayer > написал: > >> O

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-21 Thread Антонио Антуан
qlalchemy/orm/session.py", line 1336, in get_bind File "build/bdist.linux-x86_64/egg/sqlalchemy/sql/elements.py", line 539, in __bool__ TypeError: Boolean value of this clause is not defined > > > > Simon > > > > > > > > On Fri, Oct 2

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-20 Thread Антонио Антуан
__version__ '1.0.19' пятница, 20 октября 2017 г., 16:42:23 UTC+3 пользователь Simon King написал: > > On Fri, Oct 20, 2017 at 2:15 PM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > Hi. > > I use my own `RoutingSession` and `RoutingQuer

[sqlalchemy] mapper existance checks possibly wrong

2017-10-20 Thread Антонио Антуан
Hi. I use my own `RoutingSession` and `RoutingQuery` implementation, most of it inspired by `sqlalchemy.ext.horizontal_shard`: class RoutingSession(Session): def get_bind(self, mapper=None, clause=None, shard_id=None, **kwargs): original_bind = None try:

Re: [sqlalchemy] generate raw insert statement

2017-10-20 Thread Антонио Антуан
i, Oct 13, 2017 at 11:21 AM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > I've seen it and thought that some ways available... > > > you can maybe "capture" it via a logger but that's only as it runs. > The INSERT statement has to also return data

Re: [sqlalchemy] generate raw insert statement

2017-10-13 Thread Антонио Антуан
I've seen it and thought that some ways available... пт, 13 окт. 2017 г. в 17:30, Mike Bayer <mike...@zzzcomputing.com>: > On Fri, Oct 13, 2017 at 8:43 AM, Антонио Антуан <a.ch@gmail.com> > wrote: > > I use such code to generate raw SQL from SQLA-queries: >

[sqlalchemy] generate raw insert statement

2017-10-13 Thread Антонио Антуан
I use such code to generate raw SQL from SQLA-queries: def compile_statement(statement): comp = statement.compile(dialect=postgresql.dialect()) params = {} for k, v in comp.params.items(): if isinstance(v, unicode): v = v.encode(cls.encoding) params[k] =

Re: [sqlalchemy] several questions about connection pooling behaviour

2017-09-01 Thread Антонио Антуан
Ok, thank you for the answer, appreciate it. пятница, 1 сентября 2017 г., 21:11:26 UTC+3 пользователь Mike Bayer написал: > > On Fri, Sep 1, 2017 at 12:35 PM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > Yes, I tried it and it is worked fine. > > Another thing

Re: [sqlalchemy] several questions about connection pooling behaviour

2017-09-01 Thread Антонио Антуан
пятница, 1 сентября 2017 г., 18:08:35 UTC+3 пользователь Mike Bayer написал: > > On Fri, Sep 1, 2017 at 8:26 AM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > Hi guys. > > I have several questions and, possibly, misunderstandings about > sqlalchemy &

[sqlalchemy] Re: several questions about connection pooling behaviour

2017-09-01 Thread Антонио Антуан
пятница, 1 сентября 2017 г., 15:26:11 UTC+3 пользователь Антонио Антуан написал: > > Hi guys. > I have several questions and, possibly, misunderstandings about sqlalchemy > connection pooling behavior > > 1. I try to figure out if this is normal: > https:/

[sqlalchemy] several questions about connection pooling behaviour

2017-09-01 Thread Антонио Антуан
Hi guys. I have several questions and, possibly, misunderstandings about sqlalchemy connection pooling behavior 1. I try to figure out if this is normal: https://gist.github.com/aCLr/be78f3495892978ee868c9b5adcef0e6 As you can see, I checked that `bind` is the same on `get_bind()` invokation

Re: [sqlalchemy] horizontal sharding and bulk_insert

2017-08-28 Thread Антонио Антуан
t 2:01 AM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > > > > > > > > So, and now we always make queries without shard_id chosing: we always > make > > queries on 'default' database. One exception: when we run app on master > and >

Re: [sqlalchemy] horizontal sharding and bulk_insert

2017-08-23 Thread Антонио Антуан
вторник, 22 августа 2017 г., 17:29:41 UTC+3 пользователь Mike Bayer написал: > > On Tue, Aug 22, 2017 at 3:43 AM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > Hi guys > > I tried to implement horizontal sharding in my project. Everything is > ok, > >

[sqlalchemy] horizontal sharding and bulk_insert

2017-08-22 Thread Антонио Антуан
Hi guys I tried to implement horizontal sharding in my project. Everything is ok, except bulk_inserts. When I run tests, I got this error: File "/home/anton/Projects/proj/core/model/messages.py", line 210, in create

Re: [sqlalchemy] enable/disable event listeners

2017-07-08 Thread Антонио Антуан
нтонио Антуан написал: > > > >> >> On Fri, Jul 7, 2017 at 3:07 PM, Антонио Антуан <a.ch...@gmail.com> >> wrote: >> > Looks like it is not possible, isn't it? >> > >> > -- >> > SQLAlchemy - >> > The P

Re: [sqlalchemy] enable/disable event listeners

2017-07-08 Thread Антонио Антуан
> > On Fri, Jul 7, 2017 at 3:07 PM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > Looks like it is not possible, isn't it? > > > > -- > > SQLAlchemy - > > The Python SQL Toolkit and Object Relational Mapper > > > > http://w

[sqlalchemy] enable/disable event listeners

2017-07-07 Thread Антонио Антуан
Looks like it is not possible, isn't it? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.

[sqlalchemy] enable/disable event listeners

2017-07-04 Thread Антонио Антуан
Hi all. In case of unit-testing I need to disable all event listeners on model/session/etc. When particular test finished I need to enable all listeners. Is there any ways to achieve this? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To

Re: [sqlalchemy] how not to add tablename as column prefix

2017-06-06 Thread Антонио Антуан
вторник, 6 июня 2017 г., 19:46:43 UTC+3 пользователь Mike Bayer написал: > > > > On 06/06/2017 11:14 AM, Антонио Антуан wrote: > > Hi. > > I want to generate query without tablename as columns prefix. How can I > > do this? > > For example, query /Sessi

[sqlalchemy] how not to add tablename as column prefix

2017-06-06 Thread Антонио Антуан
Hi. I want to generate query without tablename as columns prefix. How can I do this? For example, query *Session.query(table.id).filter(table.time > func.now())* compiles to *SELECT table.id FROM table WHERE table.time > now(). *I want to get *SELECT id FROM table WHERE time > now(). * I want

Re: [sqlalchemy] autogenerate migrations with alembic for inherited tables

2017-04-24 Thread Антонио Антуан
пятница, 21 апреля 2017 г., 17:07:34 UTC+3 пользователь Mike Bayer написал: > > > > On 04/21/2017 09:16 AM, Антонио Антуан wrote: > > Helllo. > > I have a model, with specified __tablename__ = 'base_table'. > > In postgresql, the table has trigger, whi

[sqlalchemy] autogenerate migrations with alembic for inherited tables

2017-04-21 Thread Антонио Антуан
Helllo. I have a model, with specified __tablename__ = 'base_table'. In postgresql, the table has trigger, which executes before each insert: it creates partition for current month (if it not exist yet), specifies "INHERITS (base_table)" for new partition and insert data into it. Is there any

Re: [sqlalchemy] postgresql tuple as function argument

2017-04-12 Thread Антонио Антуан
all(e) > > > > s = Session(e) > > s.add(A(x="x", y="y")) > > s.commit() > > > > row = s.query(func.array_agg(tuple_(A.x, A.y), > > type_=ARRAY(Unicode))).scalar() > > print row > > > > > >

Re: [sqlalchemy] postgresql tuple as function argument

2017-04-12 Thread Антонио Антуан
> id = Column(Integer, primary_key=True) > x = Column(Unicode) > y = Column(Unicode) > > e = create_engine("postgresql://scott:tiger@localhost/test", echo=True) > Base.metadata.drop_all(e) > Base.metadata.create_all(e) > > s = Session(e)

[sqlalchemy] postgresql tuple as function argument

2017-04-11 Thread Антонио Антуан
Hi I want to build such query with sqlalchemy: SELECT array_agg((column1, column2)) from table Using psql it works perfectly and returns such result: {"(col1_row1_value, col2_row1_value)", "(col1_row2_value, col2_row2_value)" ...} I tried several forms of SQLA-query: >> from

Re: [sqlalchemy] How to get `func` attribute from hybrid_method

2017-03-14 Thread Антонио Антуан
вторник, 14 марта 2017 г., 17:15:25 UTC+3 пользователь Mike Bayer написал: > > > > On 03/14/2017 10:02 AM, Антонио Антуан wrote: > > Hi. > > I use sqlalchemy 1.0.17, thanks for you great library :) > > > > I have such code: > &g

[sqlalchemy] How to get `func` attribute from hybrid_method

2017-03-14 Thread Антонио Антуан
Hi. I use sqlalchemy 1.0.17, thanks for you great library :) I have such code: class FlagsMixin(object): @hybrid_method def exist_flag(self, flag): if not self.flags or not flag: return False return self.flags & flag == flag @exist_flag.expression

Re: [sqlalchemy] Set query timeout

2016-12-04 Thread Антонио Антуан
what kind of database you're using and you'd need to check the > documentation for that database on how that would be done. > > > On 12/02/2016 02:32 AM, Антонио Антуан wrote: > > Hi > > Is there any ways to set timeout for particular query, instead of the > > who

[sqlalchemy] Set query timeout

2016-12-01 Thread Антонио Антуан
Hi Is there any ways to set timeout for particular query, instead of the whole session/connection? Thanks -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example.

Re: [sqlalchemy] SAWarning shows not immediately, but after some time of app execution

2016-07-19 Thread Антонио Антуан
Looks like `my_ids` become empty 'after some time of app execution'. How do you initialize the variable? вт, 19 июля 2016 г., 18:51 TomS. : > Hi, > > We have Flask app which uses SQLAlchemy. Weird error started to happen > recently. The difficulty is that we can't reproduce

Re: [sqlalchemy] Recursive CTE failing with (pysqlite2.dbapi2.OperationalError) no such table

2016-07-13 Thread Антонио Антуан
`cteq_alias.union_all(...` Also, you do not need to create cteq_alias, you can use cteq, like in your query, but you have to replace cteq_alias.c.id with cteq.c.id ср, 13 июл. 2016 г. в 15:20, Jonathan Underwood < jonathan.underw...@gmail.com>: > Hi, > > I am struggling to get a simple

Re: [sqlalchemy] Re: Specify query_cls for the one query

2016-07-13 Thread Антонио Антуан
end database the query should be issued against, which I > guess is what your "_analyze_base_query" method does. > > Would this work for you? > > Simon > > > On Tue, Jul 12, 2016 at 3:03 PM, Антонио Антуан <a.ch@gmail.com> > wrote: > > Ok, I define my

Re: [sqlalchemy] Re: Specify query_cls for the one query

2016-07-12 Thread Антонио Антуан
existing session. > > What does your CustomQueryCls do? Perhaps there's another way of doing > what you want? > > Simon > > On Tue, Jul 12, 2016 at 11:09 AM, Антонио Антуан <a.ch...@gmail.com > > wrote: > > But it means that I should create one more s

[sqlalchemy] Re: Specify query_cls for the one query

2016-07-12 Thread Антонио Антуан
But it means that I should create one more session with one more connection to DB. This is not good for me :( понедельник, 11 июля 2016 г., 22:23:11 UTC+3 пользователь Антонио Антуан написал: > > Can I specify query_cls only for a one query? I try to change > query.session._

[sqlalchemy] Specify query_cls for the one query

2016-07-11 Thread Антонио Антуан
Can I specify query_cls only for a one query? I try to change query.session._query_cls and, of course, it doesn't work... I want to perform something like this: query = Session.query(MyModel)... default_querycls_result = query.all() custom_querycls_result =

Re: [sqlalchemy] Changing columns in query

2016-05-02 Thread Антонио Антуан
пользователь Mike Bayer написал: > > yes please use query.with_entities > > > http://docs.sqlalchemy.org/en/rel_1_0/orm/query.html?highlight=query.with_entities#sqlalchemy.orm.query.Query.with_entities > > > > On 04/30/2016 02:33 AM, Антонио Антуан wrote: > > &g

[sqlalchemy] Changing columns in query

2016-04-30 Thread Антонио Антуан
I have the query: q = Session.query(func.array_agg(Order.col)) The compiled query will be: SELECT array_agg(order.col) FROM orders I want dynamically replace the existing column. After replacing query have to be: SELECT group_concat(orders.col) FROM orders I have to use Session and model. I