[sqlalchemy] Manually escape a string for raw SQL

2014-09-01 Thread warvariuc
http://stackoverflow.com/questions/25617293/manually-escape-a-string-for-raw-sql -- 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+unsubscr...@googlegroup

[sqlalchemy] CollatedWarningsError Incorrect string value with MySQL

2014-09-01 Thread Jorge Araya Navarro
Hello! First and foremost, I want to apology if this email shouldn't go into this email list. Ok, I'm facing this ugly problem in SQLAlchemy with MySQL. Every time I want to insert a Unicode string into the database this error is triggered: sqlalchemy.exc.DBAPIError: (CollatedWarningsError)

Re: [sqlalchemy] KeyError when reflecting tables with non-numeric characters in index columns (Oracle / MSSQL)

2014-09-01 Thread Ivan Smirnov
Will post the full DDL tomorrow when I get to it; the backend is cx_oracle. On Monday, 1 September 2014 19:14:14 UTC+1, Michael Bayer wrote: > > what’s the nature of an index that reports a column with the name > “m_row$$”, is that a column that is present in the related table or is that > some

Re: [sqlalchemy] KeyError when reflecting tables with non-numeric characters in index columns (Oracle / MSSQL)

2014-09-01 Thread Michael Bayer
what's the nature of an index that reports a column with the name "m_row$$", is that a column that is present in the related table or is that some kind of virtual column? test case (e.g. full CREATE TABLE , CREATE INDEX statements please) which backend ? (seems odd that both oracle AND mssql

[sqlalchemy] KeyError when reflecting tables with non-numeric characters in index columns (Oracle / MSSQL)

2014-09-01 Thread Ivan Smirnov
py27/lib/python2.7/site-packages/sqlalchemy/engine/reflection.pyc in reflecttable(self, table, include_columns, exclude_columns) 591 cols_by_orig_name[c] if c in cols_by_orig_name 592 else table.c[c] --> 593 for c in columns 594

[sqlalchemy] Re: Creating a partial unique index on SQLite

2014-09-01 Thread Lele Gaifax
Michael Bayer writes: > from sqlalchemy import event, DDL > > @event.listens_for(MyModel.__table__, "after_create") > DDL("create index my_index...") Thank you Michael! As usual it's very easy to underestimate the versatility of your library :-) For the record, the actual statement I used is mo

Re: [sqlalchemy] Best way to implement Declarative model for multiple bases

2014-09-01 Thread Michael Bayer
On Sep 1, 2014, at 10:49 AM, Wouter van Bommel wrote: > Hi All, > > Currently I am trying to figure out the best way to solve the following > problem. > > I have a database with 16 tables, defined in 16 declarative object > definitions. This all works as expected. > > The problem I am now f

[sqlalchemy] Best way to implement Declarative model for multiple bases

2014-09-01 Thread Wouter van Bommel
Hi All, Currently I am trying to figure out the best way to solve the following problem. I have a database with 16 tables, defined in 16 declarative object definitions. This all works as expected. The problem I am now facing is that from one of the definitions I do need 2 versions, which are

Re: [sqlalchemy] Creating a partial unique index on SQLite

2014-09-01 Thread Michael Bayer
On Sep 1, 2014, at 4:29 AM, Lele Gaifax wrote: > Hi all, > > I'd need to create a partial index on a SQLite database > (http://www.sqlite.org/partialindex.html), but it seems that there's no > equivalent of "postgresql_where" on the sqlite dialect. > > The need arises from wanting a unique con

[sqlalchemy] Creating a partial unique index on SQLite

2014-09-01 Thread Lele Gaifax
Hi all, I'd need to create a partial index on a SQLite database (http://www.sqlite.org/partialindex.html), but it seems that there's no equivalent of "postgresql_where" on the sqlite dialect. The need arises from wanting a unique constraint on a subset of the dataset. Other than properly impleme