[sqlalchemy] Session / declarative_base scope

2016-09-28 Thread Warwick Prince
Hi Mike I would like a little insight into the session object, and the declarative_base class. I have a process running many threads, where each thread may be connected to potentially a different engine/database. If the database connection between 2 or more threads is the same, then they

[sqlalchemy] How can I programmatically give a hybrid_property its name?

2016-09-28 Thread Jinghui Niu
The documentation shows that hybrid_property should used as a decorator, like: @hybrid_property def my_property(self): pass What if I wanted to give this hybrid property a name by referring a variable in runtime? Is this allowed? Thanks. -- You received this message because you are

Re: [sqlalchemy] SQLAlchemy asyncio ThreadPoolExecutor “Too many clients”

2016-09-28 Thread Viktor Roytman
Yes, the problem was the call to engine.dispose() Thanks! On Wednesday, September 28, 2016 at 5:11:59 PM UTC-4, Mike Bayer wrote: > > > > it would appear that either the ThreadExecutorPool is starting more > threads than your Postgresql database has available connections, or your >

Re: [sqlalchemy] Feedback appreciated

2016-09-28 Thread Seth P
On Wednesday, September 28, 2016 at 5:43:04 PM UTC-4, Mike Bayer wrote: > > looks incredibly difficult. I'm not really about to have the resources > to work with a type that awkward anytime soon, unfortunately. If it > could be made to be a drop-in for 1.1's ARRAY feature, that would be >

Re: [sqlalchemy] Feedback appreciated

2016-09-28 Thread Mike Bayer
On 09/28/2016 12:45 PM, Seth P wrote: On Wednesday, September 28, 2016 at 10:16:20 AM UTC-4, Mike Bayer wrote: So illustrating VARRAY round trip on cx_oracle is the first step. It looks like cx_Oracle supports reading varrays, but supports writing them only as column literals, not as

Re: [sqlalchemy] SQLAlchemy asyncio ThreadPoolExecutor “Too many clients”

2016-09-28 Thread Mike Bayer
On 09/28/2016 04:51 PM, Viktor Roytman wrote: I wrote a script with this sort of logic in order to insert many records into a PostgreSQL table as they are generated. | |#!/usr/bin/env python3 importasyncio fromconcurrent.futures importProcessPoolExecutoraspool fromfunctools importpartial

[sqlalchemy] SQLAlchemy asyncio ThreadPoolExecutor “Too many clients”

2016-09-28 Thread Viktor Roytman
I wrote a script with this sort of logic in order to insert many records into a PostgreSQL table as they are generated. #!/usr/bin/env python3 import asyncio from concurrent.futures import ProcessPoolExecutor as pool from functools import partial import sqlalchemy as sa from

Re: [sqlalchemy] on_conflict_do_update (ON CONFLICT ... Postgresql 9.5) WHERE clause problem

2016-09-28 Thread Mike Bayer
this is likely use cases that have been untested, if you can file this w/ a complete test case as a bug report on bitbucket we can start looking into it. On 09/28/2016 12:05 PM, Paweł Szynkiewicz wrote: Hello all SA: 1.1.0b3 db: postgresql 9.5 I have a problem with method

Re: [sqlalchemy] Feedback appreciated

2016-09-28 Thread Seth P
On Wednesday, September 28, 2016 at 10:16:20 AM UTC-4, Mike Bayer wrote: > > > So illustrating VARRAY round trip on cx_oracle is the first step. > It looks like cx_Oracle supports reading varrays, but supports writing them only as column literals, not as bound parameters. The following code

[sqlalchemy] on_conflict_do_update (ON CONFLICT ... Postgresql 9.5) WHERE clause problem

2016-09-28 Thread Paweł Szynkiewicz
Hello all SA: 1.1.0b3 db: postgresql 9.5 I have a problem with method on_conflict_do_update for pg specific insert. Precisely with the where argument. It looks like wrong SQL statement is generated. example: class Foo(Base): ... bar = Column(Integer) insert_stmt = insert(Foo)

Re: [sqlalchemy] Re: [RFC] Connecting SqlAlchemy to NoSQL DBs

2016-09-28 Thread Olemis Lang
On 9/28/16, Ashfaque Siddiqui wrote: > Hey Olemis, > > Did you ever find anything in response to this request? Unfortunately , not quite . Though I've heard of a project named MongoAlchemy [1]_ . I am not sure of how much related it is to SQLAlchemy at all . OTOH Apacha

Re: [sqlalchemy] concerns over generating a bitwise comparison in postgres - (or "can columns be explicit in a text filter?"

2016-09-28 Thread Jonathan Vanasco
Ok. I'll put a note on the code and leave as is. The cast/bit/op is just too hard to read for maintenance. BUT it might be okay in one spot as a compiles function. I think i may do that! Thanks, Mike! -- You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: SQLAlchemy - Bulk update using sqlalchemy core table.update() expects all columns in the values data

2016-09-28 Thread Seth P
Oops, I missed that this is an UPDATE rather than an INSERT. Setting the missing columns to None probably isn't what you want. On Wednesday, September 28, 2016 at 9:08:00 AM UTC-4, Seth P wrote: > > Can't you include the missing columns in your dictionary with None values? > -- You received

Re: [sqlalchemy] SQLAlchemy - Bulk update using sqlalchemy core table.update() expects all columns in the values data

2016-09-28 Thread Mike Bayer
On 09/28/2016 04:29 AM, Rajesh Rolo wrote: I'm trying to do a bulk update using core SQLAlchemy to a postgres database. bulk_update_mappings does not work (reports StaleDataError). So I'm trying to use core functions to do a bulk update. This works fine when the update data passed to the

Re: [sqlalchemy] Feedback appreciated

2016-09-28 Thread Mike Bayer
On 09/28/2016 10:05 AM, Seth P wrote: On Friday, August 23, 2013 at 3:52:54 PM UTC-4, Konsta Vesterinen wrote: On Friday, August 23, 2013 1:52:41 AM UTC+3, Michael Bayer wrote: 2. ScalarListType vs. Postgresql ARRAY ? same/better? should SLT use ARRAY on a PG

Re: [sqlalchemy] Inserting VARBINARY(MAX) columns with MSSQL/SQLAlchemy

2016-09-28 Thread Mike Bayer
On 09/28/2016 02:32 AM, jonathan.schu...@gmail.com wrote: Usual apologies for newbie question... I'm trying to use SQLAlchemy to insert data into a MSSQL DB with columns of type VARBINARY(MAX). The only way I could find to avoid the error message Implicit conversion from data type

Re: [sqlalchemy] Feedback appreciated

2016-09-28 Thread Seth P
On Friday, August 23, 2013 at 3:52:54 PM UTC-4, Konsta Vesterinen wrote: > > > > On Friday, August 23, 2013 1:52:41 AM UTC+3, Michael Bayer wrote: > > >> 2. ScalarListType vs. Postgresql ARRAY ? same/better? should SLT use >> ARRAY on a PG backend ? >> > > Hmm I'm not sure about this yet.

Re: [sqlalchemy] concerns over generating a bitwise comparison in postgres - (or "can columns be explicit in a text filter?"

2016-09-28 Thread Mike Bayer
On 09/27/2016 05:12 PM, Jonathan Vanasco wrote: Let's say that I have a table such as this: CREATE TABLE foo ( id SERIAL PRIMARY KEY, attribute_toggles INT DEFAULT NULL ); CREATE INDEX idx_attribute_toggles ON foo(CAST(attribute_toggles AS BIT(32)))

[sqlalchemy] Re: SQLAlchemy - Bulk update using sqlalchemy core table.update() expects all columns in the values data

2016-09-28 Thread Seth P
Can't you include the missing columns in your dictionary with None values? -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[sqlalchemy] SQLAlchemy - Bulk update using sqlalchemy core table.update() expects all columns in the values data

2016-09-28 Thread Rajesh Rolo
I'm trying to do a bulk update using core SQLAlchemy to a postgres database. bulk_update_mappings does not work (reports StaleDataError). So I'm trying to use core functions to do a bulk update. This works fine when the update data passed to the values have all the columns in the db but

[sqlalchemy] Inserting VARBINARY(MAX) columns with MSSQL/SQLAlchemy

2016-09-28 Thread jonathan . schultz
Usual apologies for newbie question... I'm trying to use SQLAlchemy to insert data into a MSSQL DB with columns of type VARBINARY(MAX). The only way I could find to avoid the error message > Implicit conversion from data type varchar to varbinary(max) is not > allowed. Use the CONVERT