Re: [sqlalchemy] [SQLAlchemy Core] JSONB in dynamic select

2018-06-16 Thread Maciek Olko
Thank you very much! W dniu piątek, 15 czerwca 2018 02:43:08 UTC+2 użytkownik Mike Bayer napisał: > > On Thu, Jun 14, 2018 at 11:25 AM, Maciek Olko > wrote: > > Hello, > > I'm having difficulty in expressing such PostgreSQL code in SQLAlchemy: > > &

[sqlalchemy] Re: [SQLAlchemy Core] JSONB in dynamic select

2018-06-15 Thread Maciek Olko
Here is what I have for now: sa.func.string_agg(sa.select([('jsonb_array_elements')['{}'].astext]).select_from(sa.select([ sa.func.jsonb_array_elements(c.acc_licence_plates)])), ' / ') But it's wrong. Regards, Maciej czw., 14 cze 2018 o 17:25 użytkownik Ma

[sqlalchemy] [SQLAlchemy Core] JSONB in dynamic select

2018-06-14 Thread Maciek Olko
Hello, I'm having difficulty in expressing such PostgreSQL code in SQLAlchemy: select string_agg(test::jsonb#>>'{}', ' / ') from (select jsonb_array_elements('["raz","dwa"]') as test) as foo; At the end I'd like to have reference to real JSON column value (which is guaranteed to be JSON array) in