Re: [sqlalchemy] Alembic migrations hanging on busy RDS PostgreSQL servers

2018-01-17 Thread George V. Reilly
, test it on > a staging database first, then run in production. > > then again, the ALTER will probably be extremely quick if you can in > fact pause the load for a few minutes, since you are defaulting to > NULL. > > On Tue, Jan 16, 2018 at 3:42 PM, George V. Reilly

[sqlalchemy] Alembic migrations hanging on busy RDS PostgreSQL servers

2018-01-16 Thread George V. Reilly
Twice recently, on two different PostgreSQL 9.5 databases hosted at Amazon RDS, we've been unable to apply Alembic migrations. We have successfully run dozens of Alembic migrations in the past against one of these databases but those were quieter times for us. As far as I can tell, it's because

Re: [sqlalchemy] Capturing query parameters

2015-09-27 Thread George V. Reilly
On Saturday, September 19, 2015 at 8:14:31 AM UTC-7, Michael Bayer wrote: > > > > On 9/18/15 7:58 PM, George Reilly wrote: > > > Thanks for the prompt answer. I tried after_cursor_execute, but it didn't > really help as I just got a tuple of the values, without a clear way to > associate them

[sqlalchemy] SQLTap 0.3.10 released

2015-09-27 Thread George V. Reilly
SQLTap is a very useful library that helps you in profiling SQLAlchemy queries. It helps you understand where and when SQLAlchemy issues queries, how often they are issued, how many rows are returned, and if you are issuing queries with duplicate parameters. The last two are new in tonight's

[sqlalchemy] deleting many-to-many association records

2014-05-21 Thread George V. Reilly
I've spent time unsuccessfully trying to fix some problems with a many-to-many table and lazy joins. Here's a simplified repro: #!/usr/bin/env python # -*- coding: utf-8 -*- import random from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column,

Re: [sqlalchemy] deleting from a many-to-many association table

2014-05-21 Thread George V. Reilly
Thanks! I went with Appointment.persons = relationship( 'AppointmentPerson', cascade='delete-orphan, delete, save-update, merge, expunge', lazy=LAZYJOIN) and used the slice notation to empty the InstrumentedList: appt.persons[:] = [] In my real app, I spent

[sqlalchemy] Cross-shard queries

2012-03-11 Thread George V. Reilly
We ran into a nasty problem with sharding a while back. We came up with an effective workaround, but we don't fully understand the problem. Perhaps someone here can provide more insight. We shard requests to our production MySQL databases using sqlalchemy.ext.horizontal_shard.ShardedSession.

Re: [sqlalchemy] Logging raw SQL statements

2011-02-09 Thread George V. Reilly
The combination of create_engine(..., echo=True) and logging.basicConfig(level=logging.DEBUG) logging.getLogger('sqlalchemy').setLevel(logging.DEBUG) does the trick for me now. Thanks! /George -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

[sqlalchemy] Training or consultant?

2010-08-18 Thread George V. Reilly
Is there such a thing as SQLAlchemy training or a SA consultant? I'm starting to think that my team might benefit from some time with someone who really knows their stuff. /George Reilly, Seattle -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

[sqlalchemy] Sharing types between dialects

2010-05-06 Thread George V. Reilly
Our production database uses MySQL. For various reasons, the schema often uses MySQL-specific DDL. We want that represented in our mapper classes. We also awant to be able to exercise our SQLAlchemy unit tests against both local MySQL databases and SQLite databases. Using the MySQL-specific types

[sqlalchemy] Re: Sharing types between dialects

2010-05-06 Thread George V. Reilly
Thanks, Michael. On May 6, 7:48 am, Michael Bayer mike...@zzzcomputing.com wrote: On May 6, 2010, at 3:35 AM, George V. Reilly wrote: Our production database uses MySQL. For various reasons, the schema often uses MySQL-specific DDL. We want that represented in our mapper classes. We also

[sqlalchemy] Inserting comments into SQL queries

2010-04-13 Thread George V. Reilly
a /* comment */ inserted by my code. /George V. Reilly, Seattle -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr

[sqlalchemy] Re: Sharding with _BindParamClause

2010-04-02 Thread George V. Reilly
Michael Bayer wrote: check out r0ddd638f1d90 in mercurial.  I've added the function from the example below, plus support for in_op(), to the attribute_shard example. The old ClauseVisitor method is removed and replaced with this more robust method. Very nice! Thanks, Michael. /George --

[sqlalchemy] Re: Sharding with _BindParamClause

2010-04-02 Thread George V. Reilly
On Apr 2, 4:43 pm, George V. Reilly george.v.rei...@gmail.com wrote: Michael Bayer wrote: check out r0ddd638f1d90 in mercurial.  I've added the function from the example below, plus support for in_op(), to the attribute_shard example. The old ClauseVisitor method is removed and replaced

[sqlalchemy] Re: Sharding with _BindParamClause

2010-04-01 Thread George V. Reilly
On Mar 30, 4:42 pm, Michael Bayer mike...@zzzcomputing.com wrote: George V. Reilly wrote: We're using SQLAlchemy sharding to partition accounts across a couple of databases. We want to add more partitions, but first we need to eliminate some unnecessary cross-partition queries

[sqlalchemy] Sharding with _BindParamClause

2010-03-30 Thread George V. Reilly
param)s', None, type_=UUID()) Typically, I'm seeing this come out of the innards of SQLAlchemy, as one of several queries triggered by, say, a session.merge(). How do we work around this? Thanks! /George V. Reilly, Seattle -- You received this message because you are subscribed to the Google