Re: [sqlalchemy] Call Microsoft SQL Server static methods with double colons

2019-11-26 Thread Sebastian Eckweiler
Hi thanks for the quick reply - this works just fine. The whitespace appears to be okay. It also helped solving the next issue of calling functions with method-like dot-notation like in: https://docs.microsoft.com/en-us/sql/t-sql/spatial-geography/stastext-geography-data-type?view=sql-server-ver

Re: [sqlalchemy] Call Microsoft SQL Server static methods with double colons

2019-11-26 Thread Mike Bayer
On Tue, Nov 26, 2019, at 10:45 AM, Sebastian Eckweiler wrote: > Hi there, > > I'm trying to do with Microsoft SQL Server what this snippet: > https://docs.sqlalchemy.org/en/13/core/custom_types.html#types-sql-value-processing > does for PostGIS. > > Unfortunately in MSSQL "ST_GeomFromText" does

[sqlalchemy] Call Microsoft SQL Server static methods with double colons

2019-11-26 Thread Sebastian Eckweiler
Hi there, I'm trying to do with Microsoft SQL Server what this snippet: https://docs.sqlalchemy.org/en/13/core/custom_types.html#types-sql-value-processing does for PostGIS. Unfortunately in MSSQL "ST_GeomFromText" does not exist in the default function namespace, but is a static method of the g

Re: [sqlalchemy] Performance issues with multi-shard (engines) sharing the same bakery / LRUCache

2019-11-26 Thread Mike Bayer
On Tue, Nov 26, 2019, at 3:01 AM, Carson Ip wrote: > Hi Mike, > > Thanks for the swift response. > > Then I guess the easiest fix for me is to modify the cache key composition to > replace the dialect object part with a dialect summary (e.g. type + version) > that is the same between all engi

Re: [sqlalchemy] Accessing rowid when adding or merging in Oracle

2019-11-26 Thread Javier Collado Jiménez
You nailed it! (it almost runs out of the box) The only change needed is: return sqlalchemy.and_(*conditions) instead of return sqlalchemy.and_(conditions) THANK YOU!! El martes, 26 de noviembre de 2019, 14:11:06 (UTC+1), Simon King escribió: > > Something like this perhaps? (untested)

Re: [sqlalchemy] Accessing rowid when adding or merging in Oracle

2019-11-26 Thread Simon King
Something like this perhaps? (untested) def getwhereclause(table, filters): conditions = [] for colname, value in filters.items(): column = table.c[colname] conditions.append(column == value) return sqlalchemy.and_(conditions) whereclause = getwhereclause(table, filter

Re: [sqlalchemy] Accessing rowid when adding or merging in Oracle

2019-11-26 Thread Javier Collado Jiménez
Is there an easy way to construct the where clause for update with a dictionary? I'm trying statement=table.update().where(**filters).values(**datum).returning(table.c.rowid) but it doesn't work. Thank you!! El miércoles, 20 de noviembre de 2019, 16:39:36 (UTC+1), Mike Bayer escribió: > > >

Re: [sqlalchemy] Performance issues with multi-shard (engines) sharing the same bakery / LRUCache

2019-11-26 Thread Carson Ip
Hi Mike, Thanks for the swift response. Then I guess the easiest fix for me is to modify the cache key composition to replace the dialect object part with a dialect summary (e.g. type + version) that is the same between all engines. But it requires a guarantee that all compiled SQL queries mus