Re: [sqlalchemy] "Virtual models" for JSONB data?

2020-07-07 Thread Burak Arslan
On 03/07/2020 16:21, Pedro Ferreira wrote: > Hi, > > I was wondering if there's some way to create some sort of a "virtual" > model which is not based on an actual table? > > Use case: I have a model (e.g. `Room`) which contains a `data` JSONB > attribute/column which is supposed to store

Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Burak Arslan
On 07/19/16 20:37, Burak Arslan wrote: > > On 07/19/16 20:19, Burak Arslan wrote: >> On 07/19/16 19:38, Mike Bayer wrote: >>> this warning will be removed in 1.1, see >>> https://bitbucket.org/zzzeek/sqlalchemy/issues/3749 >> That's nice but am I to und

Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Burak Arslan
On 07/19/16 20:19, Burak Arslan wrote: > > On 07/19/16 19:38, Mike Bayer wrote: >> this warning will be removed in 1.1, see >> https://bitbucket.org/zzzeek/sqlalchemy/issues/3749 > That's nice but am I to understand there is no easy way to test this? I > still wo

Re: [sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Burak Arslan
On 07/19/16 19:38, Mike Bayer wrote: > this warning will be removed in 1.1, see > https://bitbucket.org/zzzeek/sqlalchemy/issues/3749 That's nice but am I to understand there is no easy way to test this? I still wouldn't prefer generating redundant properties. Best, Burak -- You received

[sqlalchemy] Detecting relationship conflicts

2016-07-19 Thread Burak Arslan
Hi, Behold this test: https://github.com/plq/spyne/blob/be189784b02e204b031f25bc748d9236ef7dfc59/spyne/test/test_sqlalchemy.py#L314 This is for Spyne => SQLAlchemy object bridge so please ignore Spyne-specific stuff in there. I noticed that this produced warning like this:

[sqlalchemy] preserve polymorphic_identity for subclasses

2015-06-29 Thread Burak Arslan
hello, here's a test case: https://gist.github.com/plq/5ed0c135222ea76d77fc (also see below) is it possible to preserve the polymorphic_identity values of subclasses that contain changes to non-sqla parts of a class? I understand that the reason for this is D2.__mapper__.class_ != D2. Is there

Re: [sqlalchemy] ...and MVC

2015-05-26 Thread Burak Arslan
hello, On 05/25/15 16:51, c.bu...@posteo.jp wrote: I know there is no absolute solution for my question. I just want to hear your suggestions and how you do this in your practice. In which layer of the MVC-pattern are all the SQLAlchemy objects located? There should be a Session for each

Re: [sqlalchemy] Process guide - XML

2013-10-31 Thread Burak Arslan
On 10/31/13 13:20, Sayth Renshaw wrote: Hi Looking for some guidance using SQLAlchemy. In particular using SQLAlchemy to parse an XML file to the database. Do you want to map an xml schema to a database schema, or you just are looking for advice on how to put the xml blob on a database? If

Re: [sqlalchemy] [psql] string escaping quirk in like clauses

2013-07-04 Thread Burak Arslan
On 06/27/13 13:41, Simon King wrote: Remember that Python also has its own string escaping. When you write a literal '\\' in Python, you are creating a string containing a single backslash. Hi Simon, I'm aware of that. My issue is that SQLAlchemy produces an invalid query for .like('\\') in

Re: [sqlalchemy] [psql] string escaping quirk in like clauses

2013-06-28 Thread Burak Arslan
On 06/28/13 11:55, Simon King wrote: When you write this: e.execute(t.select(t.c.a.like('\\'))) ...the pattern that you are sending to SA is a single backslash, and SA is forwarding that directly to PG. What do you think the behaviour should be in this case? Well, I'd prefer sqlalchemy did

[sqlalchemy] [psql] string escaping quirk in like clauses

2013-06-27 Thread Burak Arslan
Hi, First, some background: psql (9.2.4) Type help for help. somedb=# create table a(a varchar(5)); CREATE TABLE somedb=# insert into a values (E'\\'); INSERT 0 1 somedb=# select * from a where a = '\'; a --- \ (1 row) somedb=# select * from a where a like '\'; ERROR: LIKE pattern must not

Re: [sqlalchemy] implementing implicit scalar collections

2013-05-28 Thread Burak Arslan
Hi Mike, On 05/25/13 17:59, Michael Bayer wrote: Your primary key is far from useless. If your collection consists of unique values, then that's your primary key. If your collection consists of non-unique values, but are unique to their parent, then again, that's your primary key (a

[sqlalchemy] implementing implicit scalar collections

2013-05-24 Thread Burak Arslan
Hi, I've just implemented support for scalar collections for Spyne. (In Spyne terms that's sql serialization of an array of primitives). Seems to be working fine so far. The question is: Is the association proxy the only (read/write) way of doing this? It requires the child table to be

[sqlalchemy] implementing implicit scalar collections

2013-05-23 Thread Burak Arslan
Hi, I've just implemented support for scalar collections for Spyne. (In Spyne terms that's sql serialization of an array of primitives). Seems to be working fine so far. The question is: Is the association proxy the only (read/write) way of doing this? It requires the child table to be

Re: [sqlalchemy] SQLAlchemy 0.8.0b2 released

2012-12-18 Thread Burak Arslan
Hi Michael, This is the only regression I saw migrating from 0.7.9 to 0.8b2: https://travis-ci.org/plq/spyne/jobs/3711648/#L568 The fix was to remove the pformat call: https://github.com/plq/spyne/commit/56580c280945e6d484a5f4ce3fbca682ca698778 The sqla_mapper attribute contains the table

[sqlalchemy] Fetching custom-type columns as native types

2012-12-17 Thread Burak Arslan
Hi, I have a column of type PGObjectXml. (https://github.com/arskom/spyne/blob/ed574564383ff8cc757cd4609eede6d049c9b574/spyne/util/sqlalchemy.py#L184) What is the best way of replacing the designated column type temporarily just for a select query? E.g. How do I fetch the column as a simple

[sqlalchemy] Spyne - An RPC Toolkit

2012-11-08 Thread Burak Arslan
Hi All, Spyne is an RPC toolkit that tightly integrates with SQLAlchemy. It's been in development for about two years, with its first stable release done very recently on October 29th. You can visit Spyne's web site for more information: http://spyne.io Spyne supports standard database

[sqlalchemy] recursion loop

2011-10-28 Thread Burak Arslan
hi, any ideas on what could be the cause of the following backtrace here? https://gist.github.com/1322636#comments. this is probably something i'll need to fix in rpclib code, but I don't see what causes this. sqlalchemy version is latest trunk from today. the backtrace is one line off because

Re: [sqlalchemy] recursion loop

2011-10-28 Thread Burak Arslan
On Oct 28, 2011, at 12:30 PM, Burak Arslan wrote: hi, any ideas on what could be the cause of the following backtrace here? https://gist.github.com/1322636#comments. this is probably something i'll need to fix in rpclib code, but I don't see what causes this. sqlalchemy version is latest trunk from

Re: [sqlalchemy] recursion loop

2011-10-28 Thread Burak Arslan
On 29.10.2011 00:10, Michael Bayer wrote: On Oct 28, 2011, at 3:16 PM, Burak Arslan wrote: the link I provided has both the client and server implementations to reproduce the issue, maybe you didn't scroll up? Did not scroll up, no.So looking at the sample code here, it's entirely

Re: [sqlalchemy] passing parameters to subquery in mapped select

2011-10-14 Thread Burak Arslan
On 10/14/11 18:01, Michael Bayer wrote: On Oct 14, 2011, at 10:56 AM, Burak Arslan wrote: On 10/14/11 06:40, Michael Bayer wrote: its a little awkward but if you use bindparam() in the inner select, query.params() can access those parameters just fine, you'd just need to use it in all

[sqlalchemy] passing parameters to subquery in mapped select

2011-10-13 Thread Burak Arslan
hi, is there a way to pass a parameter to a subquery inside a select mapped to a class? the generated query looks like this: select * from ( select distinct on (some_table.id) some_table.id, ... from some_table where some_condition ) as v join ... the outer select is mapped to a class, but

[sqlalchemy] Rpclib: A Transport and Protocol Agnostic Rpc Library

2011-09-26 Thread Burak Arslan
Hello, Rpclib aims to save the protocol implementers the hassle of implementing their own remote procedure call api and the application programmers the hassle of jumping through hoops just to expose their services using multiple protocols and transports. It currently supports XmlSchema and SOAP

[sqlalchemy] read event for an attribute

2011-07-06 Thread Burak Arslan
Hello, I've implemented a 'read' event for attributes, similar to 'set'. It's called 'read' and not 'get' because it's fired only when data is fetched from the database. The implementation looks a bit crude to me, as I'm not so familiar with sqlalchemy internals. (but this exercise did teach a