Alembic 0.6.3 released

2014-02-02 Thread Michael Bayer
Hey lists -

Alembic 0.6.3 is now available.

0.6.3 has a handful of bug fixes, the vast majority geared towards the 
autogenerate feature, including getting schemas to work with index and unique 
constraint detection as well as improved handling of schema attributes on Table 
objects within autogenerate.

We’ve also added support for a so-called “sourceless” mode of usage, for the 
case where you’re distributing a software package that has only .pyc or .pyo 
files.  Not something I’m too interested in myself but there you go.

Changelog is at: 
http://alembic.readthedocs.org/en/latest/changelog.html#change-0.6.3

Alembic 0.6.3 is available on pypi: https://pypi.python.org/pypi/alembic




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [sqlalchemy] Automap and naming of relationship attributes

2014-02-02 Thread Adrian Robert
Thanks, that works beautifully.

I had noticed name_for_scalar_relationship parameter but I guess wasn't 
confident enough that I understood what was going on to try it.  :-[

-- 
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...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sqlalchemy] from_statement, TextAsFrom and stored procedures

2014-02-02 Thread Michael Bayer

On Feb 2, 2014, at 12:08 AM, Matthew Phipps matt.the.m...@gmail.com wrote:

 
 db.session.commit()
 typemap = {'id': db.Integer, 'username': db.String, 'email': db.String, 
 'random_time': UTCDateTime}
 taf = text.columns(**typemap)
 users = db.session.query(User).from_statement(taf).all()
 
 This results in a stack trace:
 
 
 AttributeError: 'TextAsFrom' object has no attribute 'use_labels'
 
 Looks like TextAsFrom isn't quite select-like enough for from_statement(). I 
 tried tacking on a taf.use_labels = True before running the query, but just 
 got another error:
 
 NoSuchColumnError Traceback (most recent call last)
 ipython-input-23-c694595d6ec1 in module()
  1 users = db.session.query(User).from_statement(taf).all()
 
 
 NoSuchColumnError: Could not locate column in row for column 'user.id'
 
 Any ideas? Incidentally, we can use the taf object in a session.execute() and 
 get great results back, type processing and all. Problem is, they're just 
 tuples (or a ResultProxy before you fetchall or iterate over it). Any way to 
 convince SQLAlchemy to turn that result set into User objects, or at that 
 point should we just send those to User() ourselves?

so this is good you worked through both issues that I’m fixing for 
http://www.sqlalchemy.org/trac/ticket/2932.   So besides the “use_labels” part, 
the other thing that can make it work in 0.9.1 is to link the statement to the 
mapped Column objects themselves:

from sqlalchemy.sql.selectable import TextAsFrom
TextAsFrom.use_labels = True

s.query(User).from_statement(
text(select * from users order by id).\
columns(User.id, User.name)
)

I’m committing 2932 in a moment and I’m super really hoping I can put out 0.9.2 
today but it’s easy for me to run out of time, but 0.9.2 is definitely due.



signature.asc
Description: Message signed with OpenPGP using GPGMail


[sqlalchemy] SQLAlchemy 0.9.2 Released

2014-02-02 Thread Michael Bayer
heya list -

SQLAlchemy release 0.9.2 is now available.

Release 0.9.2, while only a point release in the new 0.9 series,
contains a large list of bug and regression fixes across ORM, Core
and dialect, as well as a significant number of new features, particularly
in the area of database metadata management.

Features include a naming convention system for database metadata
that is hoped to assist with schema management, including when using
Alembic migrations, as well as new options for constraints, Postgresql
table reflection, and copying of table metadata.   Support and
documentation has been improved for some advanced ORM patterns such as
creating relationships to complex targets.

The release also features a lot of regression fixes, so is recommended for
all users who have already upgraded to the 0.9 series.

Among other bugfixes, there are quite a few dialect-specific bug fixes including
four for MySQL alone, as well as Oracle, Postgresql, MSSQL, and SQLite, as well
as a good number of ORM fixes.

Full changelog for SQLAlchemy 0.9.2 is at: 
http://docs.sqlalchemy.org/en/rel_0_9/changelog/changelog_09.html#change-0.9.2

For an overview of what's new in SQLAlchemy 0.9 overall, see What's New in 
0.9”: http://docs.sqlalchemy.org/en/rel_0_9/changelog/migration_09.html

Download SQLAlchemy 0.9.2 at: http://www.sqlalchemy.org/download.html









signature.asc
Description: Message signed with OpenPGP using GPGMail