[sqlalchemy] postgres "similar to" in sqlalchemy expressions

2015-12-11 Thread Chris Withers
Hi All, Just wanted to double check, is this still the best way to do this: https://groups.google.com/forum/#!topic/sqlalchemy/6kZaWeqTpHA foo.op("SIMILAR TO")(bar) cheers, Chris -- You received this message because you are

Re: [sqlalchemy] postgres "similar to" in sqlalchemy expressions

2015-12-11 Thread Mike Bayer
yes, if you were feeling enthusiastic you could make your own operators: http://docs.sqlalchemy.org/en/rel_1_0/core/custom_types.html#redefining-and-creating-new-operators On 12/11/2015 07:53 AM, Chris Withers wrote: > Hi All, > > Just wanted to double check, is this still the best way to do

[sqlalchemy] Re: how to use postgresql json type in sql expression language

2015-12-11 Thread Jonathan Vanasco
http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#sqlalchemy.dialects.postgresql.JSON -- 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

Re: [sqlalchemy] how to use postgresql json type in sql expression language

2015-12-11 Thread Mike Bayer
All SQL operators are agnostic of the ORM, docs for the JSON type and examples of its special operators are at: http://docs.sqlalchemy.org/en/rel_1_0/dialects/postgresql.html?highlight=json#sqlalchemy.dialects.postgresql.JSON On 12/11/2015 03:34 AM, kk wrote: > Dear all, > I am using

[sqlalchemy] How to commit objects with circular FK references?

2015-12-11 Thread Gerald Thibault
I am basing my question off the code at http://docs.sqlalchemy.org/en/latest/orm/relationship_persistence.html#rows-that-point-to-themselves-mutually-dependent-rows, with a few changes. I am trying to handle a situation very similar to the one in that example, with 2 classes having the same

Re: Alter boolean column on Oracle

2015-12-11 Thread Ofir Herzas
Hi Mike, I've just checked my code and I noticed that I already use existing_type (not sure what was wrong with the documentation in that aspect). Can you elaborate a bit on specifying custom rules as you mentioned? I tried issuing a drop_constraint before calling the alter_column but that

Re: [sqlalchemy] How to commit objects with circular FK references?

2015-12-11 Thread Mike Bayer
On 12/11/2015 05:25 PM, Gerald Thibault wrote: > I am basing my question off the code > at > http://docs.sqlalchemy.org/en/latest/orm/relationship_persistence.html#rows-that-point-to-themselves-mutually-dependent-rows, > with a few changes. > > I am trying to handle a situation very similar to

Re: Alter boolean column on Oracle

2015-12-11 Thread Mike Bayer
On 12/11/2015 04:39 PM, Ofir Herzas wrote: > Hi Mike, > I've just checked my code and I noticed that I already use existing_type > (not sure what was wrong with the documentation in that aspect). > > Can you elaborate a bit on specifying custom rules as you mentioned? > I tried issuing a

SQLAlchemy 1.0.10 Released

2015-12-11 Thread Mike Bayer
SQLAlchemy release 1.0.10 is now available. Release 1.0.10 continues with maintenance fixes as we continue major development on the 1.1 series. Fixes here include a handful of fairly obscure ORM issues, as our userbase continues to use the new loader option system introduced in 0.9 more deeply,

[sqlalchemy] SQLAlchemy 1.0.10 Released

2015-12-11 Thread Mike Bayer
SQLAlchemy release 1.0.10 is now available. Release 1.0.10 continues with maintenance fixes as we continue major development on the 1.1 series. Fixes here include a handful of fairly obscure ORM issues, as our userbase continues to use the new loader option system introduced in 0.9 more deeply,

Re: [sqlalchemy] How to commit objects with circular FK references?

2015-12-11 Thread Gerald Thibault
Is there a way to perform a Metadata.create_all() but have it only create the tables, without any of the FKs? And then create the FKs in one go after the fixture data has been loaded into the DB? On Friday, December 11, 2015 at 3:38:16 PM UTC-8, Michael Bayer wrote: > > > > On 12/11/2015 05:25

Re: [sqlalchemy] How to commit objects with circular FK references?

2015-12-11 Thread Mike Bayer
On 12/11/2015 07:47 PM, Gerald Thibault wrote: > Is there a way to perform a Metadata.create_all() but have it only > create the tables, without any of the FKs? And then create the FKs in > one go after the fixture data has been loaded into the DB? first off, this is unnecessary because the DDL

Re: [sqlalchemy] skipping MSSQL TIMESTAMP column on INSERT

2015-12-11 Thread mdob
@event.listens_for(Table, 'column_reflect') def receive_column_reflect(inspector, table, column_info): if isinstance(column_info['type'], TIMESTAMP): column_info['default'] = FetchedValue() table = Table(table_name, metadata, autoload=True, autoload_with=engine,

Re: [sqlalchemy] skipping MSSQL TIMESTAMP column on INSERT

2015-12-11 Thread Mike Bayer
On 12/11/2015 01:12 PM, mdob wrote: > | > > @event.listens_for(Table,'column_reflect') > defreceive_column_reflect(inspector,table,column_info): > ifisinstance(column_info['type'],TIMESTAMP): > column_info['default']=FetchedValue() > the reflection wants to assume the

Re: [sqlalchemy] skipping MSSQL TIMESTAMP column on INSERT

2015-12-11 Thread mdob
Maybe this should go into server_default. Because cole belowe worked fine. for col in table.columns: if isinstance(col.type, TIMESTAMP): col.server_default = FetchedValue() Updating column_info['server_default'] = FetchedValue() in event handler didn't work. On Friday, December

[sqlalchemy] how to use postgresql json type in sql expression language

2015-12-11 Thread kk
Dear all, I am using Postgresql for the data and in some tables there is the json type field. It may often have float values and keys as strings. I don't use ORM very often but love using the sql expression api of alchemy. I wonder if there is some syntax for accessing json type without using