Re: [sqlalchemy] Searching from jsonb list

2016-01-05 Thread Jon Rosebaugh
"public.jtable" > Column | Type | Modifiers | Storage | Stats target | Description > +---+---+--+--+- > data | jsonb | | extended | | > > > > maanantai 4. tammikuuta 2016 19.41.29 UTC+2 Jo

Re: [sqlalchemy] Searching from jsonb list

2016-01-04 Thread Jon Rosebaugh
ta @> > %(data_1)s'] [parameters: {'data_1': 'third'}] > > > torstai 31. joulukuuta 2015 16.11.47 UTC+2 Jon Rosebaugh kirjoitti: > > > > Your SQL itself isn't going to work; there's no 'item' column in your > > select statement. You should read > > http://www.p

Re: [sqlalchemy] Searching from jsonb list

2015-12-31 Thread Jon Rosebaugh
Your SQL itself isn't going to work; there's no 'item' column in your select statement. You should read http://www.postgresql.org/docs/9.4/interactive/functions-json.html to see what operators you have. (I think you want '@>', not LIKE.) In SQLAlchemy, this would be done as

Re: [sqlalchemy] Defining a unique constraint on an attribute of a Postgres JSON field

2015-12-30 Thread Jon Rosebaugh
I think you might want to use the lightweight sqlalchemy.column() (lowercase!) expression; UniqueConstraint(sa.column('data', JSON)['email']) might work. On 12/30/15 5:58 PM, Andrew Muro wrote: (SQLAlchemy 1.0.11) I'm trying to figure out how to define a unique constraint from within the

Re: Select a subset of declarative classes to migrate

2015-11-18 Thread Jon Rosebaugh
Sure, but declarative classes have a table. MyModel.__table__.info['exclude_from_autogen']=True (you'll probably want to write a class decorator that sets this, actually.) On Wed, Nov 18, 2015, at 02:59 AM, Michal Petrucha wrote: > On Tue, Nov 17, 2015 at 11:26:41AM -0500, Jon Rosebaugh wr

Re: Production and Development environments

2015-11-17 Thread Jon Rosebaugh
I would definitely agree using postgres in both dev and prod is the way to go here; sqlite behaves sufficiently differently, particularly around DDL. At Axial we previously had multiple databases in concurrent use, with migrations operating on both databases at once. We modified env.py's

Re: Select a subset of declarative classes to migrate

2015-11-17 Thread Jon Rosebaugh
You can configure an include_object() function which can inspect the model and decide whether or not to include the model in autogenerated migrations: http://alembic.readthedocs.org/en/latest/api/runtime.html#alembic.runtime.environment.EnvironmentContext.configure.params.include_object Then you

Re: [sqlalchemy] Working with PostgreSQL functions that operate on selectables

2014-10-03 Thread Jon Rosebaugh
it, func.row_to_json(literal_column(ā€™sā€™)). On Oct 2, 2014, at 11:54 PM, Jon Rosebaugh cha...@gmail.com javascript: wrote: I'm having some trouble with the Postgresql function row_to_json. It's possible to use it on an entire table to turn each row from the table into a JSON object, like

[sqlalchemy] Working with PostgreSQL functions that operate on selectables

2014-10-02 Thread Jon Rosebaugh
I'm having some trouble with the Postgresql function row_to_json. It's possible to use it on an entire table to turn each row from the table into a JSON object, like select row_to_json(t) as j from some_table as t. You can also use a subselect, and that's where the trouble lies. I want to

Would be nice if Alembic exposed friendly Python interfaces

2014-06-10 Thread Jon Rosebaugh
At my workplace, we use Alembic to handle migrations, but we frequently have minor issues like forgetting to downgrade to the most recent common migration before switching git branches, or not noticing that a branch has migrations to be run when checking it out. This causes a bit of aggravation.

[sqlalchemy] Postgres composite types and sqlalchemy; Having trouble with events system; Advice requested

2013-11-03 Thread Jon Rosebaugh
I'm trying to implement support for Postgres's composite types, which essentially let you make a type which is a struct of other types. This involves several kinds of functionality: * Psycopg2 maps composite types as namedtuples. However, the register_composite() function has to be called for

[sqlalchemy] 0.8 doc url goes to 0.9 docs

2013-06-02 Thread Jon Rosebaugh
The url I've been using for the 0.8 docs (http://docs.sqlalchemy.org/en/rel_0_8/) now goes to a page listing 0.9 docs. There doesn't seem to be any way to get at 0.8's docs from the website. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

Re: [sqlalchemy] 0.8 doc url goes to 0.9 docs

2013-06-02 Thread Jon Rosebaugh
checking out master. I'm not sure how to fix this at the moment. On Jun 2, 2013, at 8:34 PM, Jon Rosebaugh cha...@gmail.com javascript: wrote: The url I've been using for the 0.8 docs ( http://docs.sqlalchemy.org/en/rel_0_8/) now goes to a page listing 0.9 docs. There doesn't seem

[sqlalchemy] Re: SQLAlchemy 0.4.2b released

2008-01-09 Thread Jon Rosebaugh
On Jan 7, 2008 2:20 PM, Michael Bayer [EMAIL PROTECTED] wrote: 0.4.2b -- - sql - changed name of TEXT to Text since its a generic type; TEXT name is deprecated until 0.5. The upgrading behavior of String to Text when no length is present is also deprecated until