[sqlalchemy] with_entities referring to SQlite column aliased with

2019-07-10 Thread Dieter Menne
I have posted this on Stackoverflow, but there was no response. https: //stackoverflow.com/questions/56891733/with-entities-referring-to-sqlite-column-aliased-with-label-self-contained-re How do I use .with_entities to refer to the items? The following fails: from sqlalchemy import Column, Int

[sqlalchemy] Re: Finding original "type" when using as_mutable()

2019-07-10 Thread Lele Gaifax
"Mike Bayer" writes: > yeah there is not a "nice" way to do that now without some new feature being > added to support > that. If "Image" is your own type, I would include that "as_mutable" sets up > additional state > somewhere, column.info is one place. sorry there is not a better solution.

Re: [sqlalchemy] Using metadata built from parent process's engine

2019-07-10 Thread Mike Bayer
On Wed, Jul 10, 2019, at 5:04 PM, Zach wrote: > Our application uses gunicorn and we are looking to enable `preload_app`. In > preparation, we moved the creation of the sqlalchemy engine into a post-fork > hook for each gunicorn worker, ensuring that DB connections are created > separately wit

[sqlalchemy] Using metadata built from parent process's engine

2019-07-10 Thread Zach
Our application uses gunicorn and we are looking to enable preload_app. In preparation, we moved the creation of the sqlalchemy engine into a post-fork hook for each gunicorn worker, ensuring that DB connections are created separately within each process. Unfortunately our sqlalchemy declarat

Re: [sqlalchemy] load extension spatialite in windows

2019-07-10 Thread Mike Bayer
On Wed, Jul 10, 2019, at 12:12 PM, Michael Lane wrote: > I tried all combination for path with your exemple and always got the same > error message: > > conn.load_extension('c:\\mydll\\mod_spatialite') > sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) OsError 0xc1 (193) > > > con

Re: [sqlalchemy] load extension spatialite in windows

2019-07-10 Thread Michael Lane
I tried all combination for path with your exemple and always got the same error message: conn.load_extension('c:\\mydll\\mod_spatialite') sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) OsError 0xc1 (193) conn = sqlite3.connect(":memory:") conn.enable_load_extension(True) conn

Re: [sqlalchemy] load extension spatialite in windows

2019-07-10 Thread Mike Bayer
I have no information on that, this has to do with the sqlite3 module included with Python: import sqlite3 conn = sqlite3.connect(":memory:") conn.load_extension("c:\\path\\to\\dll") Use cPython resources to get help and use the above code as what you're trying to get to work: https://www.pyt

Re: [sqlalchemy] Finding original "type" when using as_mutable()

2019-07-10 Thread Mike Bayer
On Wed, Jul 10, 2019, at 3:20 AM, Lele Gaifax wrote: > Hi, > > I would like to find an automated way to collect all columns of any mapped > class which type is declared as > > ColType.as_mutable(ConcreteType) > > In an application I'm developing I use sqlalchemy-media to handle multi-media >

[sqlalchemy] load extension spatialite in windows

2019-07-10 Thread Michael Lane
Try to reproduce this in windows. How to do that? Even though I put the dll file in a directory defined in %PATH% or try with/without full path, with/without file extension, with '//' or '\', with libspatialite-4.dll or

[sqlalchemy] Finding original "type" when using as_mutable()

2019-07-10 Thread Lele Gaifax
Hi, I would like to find an automated way to collect all columns of any mapped class which type is declared as ColType.as_mutable(ConcreteType) In an application I'm developing I use sqlalchemy-media to handle multi-media "attachments" to avoid storing the actual media within the database.