[sqlalchemy] Sharded query stops working with 0.4.6

2008-06-06 Thread Andrew Stromnov
After upgrading from 0.4.5 to 0.4.6 Session.execute(query, shard_id=shard_id), where Session is ShardedSession, throws exception: File '/var/lib/python-support/python2.5/sqlalchemy/orm/scoping.py', line 98 in do return getattr(self.registry(), name)(*args, **kwargs) TypeError: execute() got an

[sqlalchemy] Re: expensive .rollback() in pool implementation?

2008-05-05 Thread Andrew Stromnov
for query() and rollback() execution are comparable. Query is SELECT person_id, type, sum(count) FROM CommentCounter WHERE person = %d AND type = '%s' and answered in (0, 1) group by person_id On May 4, 7:52 pm, Michael Bayer [EMAIL PROTECTED] wrote: On May 4, 2008, at 9:41 AM, Andrew Stromnov wrote

[sqlalchemy] expensive .rollback() in pool implementation?

2008-05-04 Thread Andrew Stromnov
Recently I'd switched to SA MySQL connection pool implementation. Every time, when app returns connection to pool (through .close() method), SA triggers .rollback() on this connection (http:// www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/lib/sqlalchemy/pool.py#L291). In my case ROLLBACK is

[sqlalchemy] SQLAlchemy and SQLRelay

2008-01-14 Thread Andrew Stromnov
Is it possible to use SA with SQLRelay? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to

[sqlalchemy] Re: Stats implementation question.

2007-12-07 Thread Andrew Stromnov
I think it shoud be done throught mapping against arbitrary select ( http://www.sqlalchemy.org/docs/04/documentation.html#advdatamapping_mapper_selects ). Thanks. On 7 дек, 13:23, Andrew Stromnov [EMAIL PROTECTED] wrote: How to implement this stat behaviour (RPG-like stats): players_table

[sqlalchemy] Key error when mapping against arbitrary select

2007-12-07 Thread Andrew Stromnov
persons_table = Table(u'persons', dbconfig.metadata, Column(u'person_id', Integer(20), primary_key=True, autoincrement=True, nullable=False, default=0), Column(u'level', Integer(11), nullable=False, default=1), autoload = False) class Person(object): pass mapper(Person,

[sqlalchemy] Stats implementation question.

2007-12-07 Thread Andrew Stromnov
How to implement this stat behaviour (RPG-like stats): players_table = Table('player', Column('id', Integer, primary_key=True), Column('name', String), Column('level', Integer), ) # SELECT 'level', count('level') as 'count' FROM player ORDER BY 'level' GROUP BY 'level' # class

[sqlalchemy] How to use GROUP BY and HAVING in orm?

2007-11-13 Thread Andrew Stromnov
I have this SQL expression (from http://www.pui.ch/phred/archives/2005/04/tags-database-schemas.html) SELECT b.* FROM tagmap bt, bookmark b, tag t WHERE bt.tag_id = t.tag_id AND (t.name IN ('bookmark', 'webservice', 'semweb')) AND b.id = bt.bookmark_id GROUP BY b.id HAVING COUNT( b.id )=3 How

[sqlalchemy] create_instance() documentation typo?

2007-11-08 Thread Andrew Stromnov
At http://www.sqlalchemy.org/docs/04/sqlalchemy_orm.html#docstrings_sqlalchemy.orm_MapperExtension : def create_instance(self, mapper, selectcontext, row, class_) Receive a row when a new object instance is about to be created from that row. The method can choose to create the instance

[sqlalchemy] Re: create_instance() documentation typo?

2007-11-08 Thread Andrew Stromnov
Done. http://www.sqlalchemy.org/trac/ticket/859 On Nov 8, 8:55 pm, Michael Bayer [EMAIL PROTECTED] wrote: its a typo. if you could place a ticket in trac (with milestone 0.4xx) that would be helpful. On Nov 8, 2007, at 12:31 PM, Andrew Stromnov wrote: Athttp://www.sqlalchemy.org/docs

[sqlalchemy] Re: Ascii codec instead of unicode ?

2007-08-15 Thread Andrew Stromnov
Hi, I have two questions: 1) what exact versions of MySQL (i.e. 4.1.22) and py-mysqldb? 2) how many databases and/or tables (an encodings) used in your application? On Aug 15, 9:57 pm, Arun Kumar PG [EMAIL PROTECTED] wrote: Any other clue that may be helpful in troubleshooting the cause

[sqlalchemy] Cannot autoreflect MySQL table with minus sign ('-') in table name.

2007-07-11 Thread Andrew Stromnov
Configuration: CentOS 5 (64bit), SA (trunk), Python 2.4.4, py- MySQLdb-1.2.1, MySQL 5.1-current Traceback (most recent call last): File ./indexer.py, line 79, in ? table[database][conf] = Table(conf, metadata, autoload=True) File /usr/lib/python2.4/site-packages/sqlalchemy/schema.py,

[sqlalchemy] Re: Cannot autoreflect MySQL table with minus sign ('-') in table name.

2007-07-11 Thread Andrew Stromnov
Dirty fix (works for me): Index: mysql.py === --- mysql.py(revision 2873) +++ mysql.py(working copy) @@ -1090,7 +1090,7 @@ table.name = table.name.lower() table.metadata.tables[table.name]= table

[sqlalchemy] Re: Designing a permission system

2007-04-10 Thread Andrew Stromnov
look at http://code.google.com/p/spiff/ - SpiffGuard On Apr 10, 11:36 am, Kaali [EMAIL PROTECTED] wrote: Hi, I'm designing a permission system to our messaging platform. The platform has different channels which contains messages. Every different user can have different permissions on a

[sqlalchemy] Unicode URL error

2007-03-30 Thread Andrew Stromnov
ascii-encoded string: url = 'mysql://login:[EMAIL PROTECTED]/adverts?charset=cp1251' engine = sqlalchemy.create_engine(url, convert_unicode=True, pool_recycle=4) metadata = sqlalchemy.BoundMetaData(engine) ad_table = sqlalchemy.Table('adverts', metadata, autoload=True) unicode string:

[sqlalchemy] Re: matz blogged us

2007-03-10 Thread Andrew Stromnov
babelfish.altavista.com (JP to EN): _SQLAlchemy - The Database Toolkit for Python The library which synthesizes SQL from usual system. As for such technology you think that well enough it is convenient. --~--~-~--~~~---~--~~ You received this message because

[sqlalchemy] Re: SQLAlchemy + MySQL encoding error (probably wrong charset=... handling)

2007-02-02 Thread Andrew Stromnov
On 2/2/07, Michael Bayer [EMAIL PROTECTED] wrote: are you saying that executing a particular statement is changing some state on the local connection ? Not exactly what I had in mind. Execution of first appeared statement assigns (underlying ?) charset for all following queries for all

[sqlalchemy] Re: SQLAlchemy + MySQL encoding error (probably wrong charset=... handling)

2007-02-01 Thread Andrew Stromnov
on the Unicode type. also note theres a bug in MySQLDB related to this: http://sourceforge.net/tracker/index.php?func=detailaid=1592353grou...http://www.sqlalchemy.org/trac/ticket/340 On Feb 1, 7:28 am, Andrew Stromnov [EMAIL PROTECTED] wrote: Python 2.4.4 (win32) + SQLAlchemy (r2285