Re: [sqlalchemy] Documentation options

2019-03-21 Thread Mike Bayer
On Thu, Mar 21, 2019 at 7:01 PM Rich Shepard wrote: > > On Thu, 21 Mar 2019, Mike Bayer wrote: > > > sounds like automap: > > https://docs.sqlalchemy.org/en/latest/orm/extensions/automap.html > > Mike, > > While this does not look familiar, I'll carefully read the page again until > I really

Re: [sqlalchemy] Documentation options

2019-03-21 Thread Rich Shepard
On Thu, 21 Mar 2019, Mike Bayer wrote: sounds like automap: https://docs.sqlalchemy.org/en/latest/orm/extensions/automap.html Mike, While this does not look familiar, I'll carefully read the page again until I really understand it. Now, model.py contains classes for each table in the

Re: [sqlalchemy] Documentation options

2019-03-21 Thread Mike Bayer
sounds like automap: https://docs.sqlalchemy.org/en/latest/orm/extensions/automap.html On Thu, Mar 21, 2019 at 6:07 PM Rich Shepard wrote: > > On Thu, 21 Mar 2019, Mike Bayer wrote: > > > oh sure, I meant it uses up an enormous amount of memory / CPU to build > > the PDF. it looks terrible too

Re: [sqlalchemy] Documentation options

2019-03-21 Thread Rich Shepard
On Thu, 21 Mar 2019, Mike Bayer wrote: oh sure, I meant it uses up an enormous amount of memory / CPU to build the PDF. it looks terrible too because sphinx's templates aren't very good, plus SQLAlchemy's docs have a bunch of custom things going on that format even more badly. Mike, Okay.

Re: [sqlalchemy] Documentation options

2019-03-21 Thread Mike Bayer
On Thu, Mar 21, 2019 at 5:11 PM Rich Shepard wrote: > > On Thu, 21 Mar 2019, Mike Bayer wrote: > > > not currently, however you can do a sphinx pdf build yourself if you > > feel like installing LaTeX, > > Mike, > > I write > 90% of my documents using LaTeX (with the LyX GUI front end). > Sphinx

Re: [sqlalchemy] Documentation options

2019-03-21 Thread Rich Shepard
On Thu, 21 Mar 2019, Mike Bayer wrote: not currently, however you can do a sphinx pdf build yourself if you feel like installing LaTeX, Mike, I write > 90% of my documents using LaTeX (with the LyX GUI front end). Sphinx is a new one for me so I'll go look at it. unfortunately SQLAlchemy's

Re: [sqlalchemy] Documentation options

2019-03-21 Thread Mike Bayer
On Thu, Mar 21, 2019 at 4:20 PM Rich Shepard wrote: > > Are there PDF versions of the docs available for downloading and reading? I > don't find an answer on the web site. not currently, however you can do a sphinx pdf build yourself if you feel like installing LaTeX, there also seems to be some

[sqlalchemy] Documentation options

2019-03-21 Thread Rich Shepard
Are there PDF versions of the docs available for downloading and reading? I don't find an answer on the web site. TIA, Rich -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and

Re: [sqlalchemy] binding parameters in quotes

2019-03-21 Thread Mike Bayer
On Thu, Mar 21, 2019 at 3:33 PM Victor Olex wrote: > > Thanks Mike, though the question is valid - why does regex in SQLAlchemy > allow for discovering parameter token inside quotes? Have you seen a > legitimate case for that? the regex in SQLAlchemy is not a SQL parser, it's just putting

Re: [sqlalchemy] binding parameters in quotes

2019-03-21 Thread Victor Olex
Thanks Mike, though the question is valid - why does regex in SQLAlchemy allow for discovering parameter token inside quotes? Have you seen a legitimate case for that? On Wednesday, March 20, 2019 at 9:58:58 AM UTC-4, Mike Bayer wrote: > > On Wed, Mar 20, 2019 at 7:59 AM mdob > > wrote: > >

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Scheck David
@mike, a real thank you for your patience. I'm sorry I was lost for a while, I understood what you said and it's what I'm doing now. Thanks for the tips and sorry for your time Le jeu. 21 mars 2019 à 17:17, Scheck David a écrit : > CREATE INDEX img_createdby_uri_index ON image ((image_metadata

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Mike Bayer
just to confirm, run this inside of any execute() callable, eg. in alembic: op.execute("CREATE INDEX img_createdby_uri_index ON image ((image_metadata -> 'systemfields' -> 'created_by' ->> 'uri'))") with an engine with engine.connect() as conn: conn.execute("CREATE INDEX

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Scheck David
CREATE INDEX img_createdby_uri_index ON image ((image_metadata -> 'systemfields' -> 'created_by' ->> 'uri')); that's what I want. thank you Le jeu. 21 mars 2019 à 14:25, Mike Bayer a écrit : > (noting again, you need the CREATE INDEX statement that PG wants. > SQLAlchemy part is only a bonus

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Mike Bayer
(noting again, you need the CREATE INDEX statement that PG wants. SQLAlchemy part is only a bonus which isn't strictly needed here). On Thu, Mar 21, 2019 at 9:24 AM Mike Bayer wrote: > can you go onto some Postgresql forums and ask there? this is a > Postgresql-specific issue. > > On Thu, Mar

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Mike Bayer
can you go onto some Postgresql forums and ask there? this is a Postgresql-specific issue. On Thu, Mar 21, 2019 at 8:44 AM Scheck David wrote: > In fact it's a function in postgresql which catch all urls and store it in > a field. but it's not what I'm searching for. I just have to create an >

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Scheck David
In fact it's a function in postgresql which catch all urls and store it in a field. but it's not what I'm searching for. I just have to create an index gin and I still don't know how to. I'm just stuck because I don't understand how to create index on a nested field.

Re: [sqlalchemy] rendering "NOT EXISTS ()" in PostgreSQL ?

2019-03-21 Thread Mike Bayer
On Wed, Mar 20, 2019 at 9:48 PM Jonathan Vanasco wrote: > > thanks, mike. I may just make a 'not exists' op. > > there are a handful of places in the docs that show `NOT EXISTS` with no > parenthesis. Do you think this is because of a change in the codebase or a > difference in the backends? >

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Mike Bayer
I hardly understand what that does but if it floats your boat, get on board ( I guess?) On Thu, Mar 21, 2019 at 4:35 AM Scheck David wrote: > I found this which could make the work. because it seems that it index all > in one field and this will improve my performances. what do you think? > >

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Scheck David
the only problems is when I'll query with SQLAlchemy with a field like : "uri,uri,uri" is there a simple query to extract this uri ? like a contains ? Le jeu. 21 mars 2019 à 09:35, Scheck David a écrit : > I found this which could make the work. because it seems that it index all > in one field

Re: [sqlalchemy] Index on nested JSONB field

2019-03-21 Thread Scheck David
I found this which could make the work. because it seems that it index all in one field and this will improve my performances. what do you think? https://stackoverflow.com/questions/40106609/indexing-nested-json-with-postgres I think this could do the trick Le mer. 20 mars 2019 à 17:03, Mike