[sqlalchemy] Re: BakedQuery with function parameters

2016-10-24 Thread Anton Baranenko
is relatively simple. Thanks again, Anton -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description

[sqlalchemy] BakedQuery with function parameters

2016-10-23 Thread Anton Baranenko
ery. The question is - how can I used BakedQuery with this setup? From the source I can guess I should use add_criteria / with_criteria, but in the unit tests / documentation I could not find an example of doing so with the function parameter values. Thank you for any help, Anton -- SQL

[sqlalchemy] Re: Using BakedQuery with joined subqueries

2016-10-23 Thread Anton Baranenko
Thank you Mike, worked as expected! > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.

[sqlalchemy] Using BakedQuery with joined subqueries

2016-10-22 Thread Anton Baranenko
ery subqueries separately and then somehow join them with the main BakedQuery (how?). Should I somehow do the BakedQuery only of the main query (what to do with subqueries then?). Thank you for any help, Anton -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper h

Re: [sqlalchemy] Default column value before an object is commited

2015-05-07 Thread Anton
they are public and safe to use. Got it. Thanks, Anton. -- 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

[sqlalchemy] Default column value before an object is commited

2015-05-06 Thread Anton
on ColumnDefault internals and partially duplicates logic from DefaultExecutionContext._exec_default() I am wondering if there is a better solution to it? Thanks, Anton. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group

[sqlalchemy] Re: Choosing pattern for vertical table like mapping.

2014-09-10 Thread Anton
mapped tables. Ensure that only those columns referring to a parent column are marked as foreign, either via the foreign() annotation or via the foreign_keys argument. I am not sure how to overcome this error. Would appreciate any help. Best, Anton. On Tuesday, September 9, 2014 1:10:40 PM UTC-7

Re: [sqlalchemy] Choosing pattern for vertical table like mapping.

2014-09-10 Thread Anton
-referencing because two models use the same table. SimpleModel is just a mixin that I use in every model I create to make sure that they all have a unique id. Thanks, Anton. On Wednesday, September 10, 2014 3:00:39 PM UTC-7, Michael Bayer wrote: On Sep 10, 2014, at 5:11 PM, Anton ansch...@gmail.com

Re: [sqlalchemy] Choosing pattern for vertical table like mapping.

2014-09-10 Thread Anton
); CREATE TABLE group_entity ( id integer NOT NULL, entity_id integer, key character varying, value text, group_id integer NOT NULL ); Best, Anton. On Wednesday, September 10, 2014 4:51:54 PM UTC-7, Michael Bayer wrote: hi Anton - if you can show me correct table designs

Re: [sqlalchemy] Choosing pattern for vertical table like mapping.

2014-09-10 Thread Anton
I already have models for group, entity and group_entity. Now I am trying to build a model that would represent an entity for a group with all the custom attributes. On Wednesday, September 10, 2014 5:06:36 PM UTC-7, Anton wrote: Mike, the tables are already there, I am trying to create

[sqlalchemy] Choosing pattern for vertical table like mapping.

2014-09-09 Thread Anton
is that there is an additional foreign key. I wonder if there is any approach I can use to adapt vertical pattern for my needs without modifying tables. Best, Anton. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails

[sqlalchemy] Re: Choosing pattern for vertical table like mapping.

2014-09-09 Thread Anton
Trying to use with multiple table mapping. On Tuesday, September 9, 2014 1:03:25 PM UTC-7, Anton wrote: Hi, I need some help choosing the right pattern for the models I have. I have the following tables: Entity (INT id, VARCHAR name) Group (INT id, VARCHAT name) GroupEntityAttributes

Re: [sqlalchemy] Speed up bulk inserts

2014-08-18 Thread Anton
and SQLAlchemy==0.9.4 Thanks! Best, Anton. On Wednesday, November 6, 2013 12:58:53 PM UTC-8, Michael Bayer wrote: I wrote a full post regarding this topic on stackoverflow at http://stackoverflow.com/questions/11769366/why-is-sqlalchemy-insert-with-sqlite-25-times-slower-than-using-sqlite3-directly

Re: [sqlalchemy] Reuse pre-defined Enum?

2014-07-03 Thread Anton
Hey guys, I am facing the same issue, I am using PostgreSQL and want to use native ENUM type in two tables. For migration I am going to use alembic. Did you guys find out any was to do this? Thanks, Anton On Thursday, May 1, 2014 10:33:21 AM UTC-7, Michael Bayer wrote: OK. ENUM

[sqlalchemy] [sqlamp] version 0.6 is out

2012-01-13 Thread anton
Hi all, I'm happy to announce the availability of sqlamp 0.6. This release introduces the support of moving nodes and adds compatibility with python 3.2 and SQLAlchemy 0.7.x. See full changelog at http://sqlamp.angri.ru/ sqlamp is an implementation of materialized path for SQLAlchemy. It is

[sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-26 Thread Anton
Michael, On 22 июн, 17:48, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 22, 2011, at 3:41 AM, Anton wrote: On 22 июн, 01:31, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 21, 2011, at 7:04 PM, Anton wrote: On 22 июн, 00:47, Michael Bayer mike...@zzzcomputing.com wrote: I

[sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-22 Thread Anton
On 22 июн, 01:31, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 21, 2011, at 7:04 PM, Anton wrote: On 22 июн, 00:47, Michael Bayer mike...@zzzcomputing.com wrote: I added StatementError after having too often a custom type or other kind of error happen deep inside the preparation

[sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-22 Thread Anton
On 22 июн, 17:48, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 22, 2011, at 3:41 AM, Anton wrote: On 22 июн, 01:31, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 21, 2011, at 7:04 PM, Anton wrote: On 22 июн, 00:47, Michael Bayer mike...@zzzcomputing.com wrote: I added

[sqlalchemy] Raising exceptions from TypeDecorator.process_bind_param()

2011-06-21 Thread anton
the exception if it is not an instance of self.dialect.dbapi.Error. 0.7 in turn does [3]. And it reraises the exception of different type - instead of the original one it uses DBAPIError.instance(), which in my case returns StatementError. How can I fix it on my side? Thanks. -- Anton [1] http

[sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-21 Thread Anton
). -- Anton On Jun 21, 2011, at 6:39 PM, an...@angri.ru wrote: Hi, I'm porting sqlamp [1] to SQLAlchemy 0.7 and have some difficulties with it. One of them is raising an exception (non-DBAPI) from process_bind_param() method of classes derived from TypeDecorator. In 0.6 [2] method

[sqlalchemy] (IntegrityError) null value in column post_id violates not-null constraint

2010-10-04 Thread Anton Shestakov
of PostTagLink instances), then it does post.tag_links = [] and tries to Session.commit() it. And fails terribly. Guts tell me I may be doing something wrong, but I don't know what exactly. I'll greatly appreciate your help. Best regards, Anton Shestakov. -- You received this message because you

Re: [sqlalchemy] (IntegrityError) null value in column post_id violates not-null constraint

2010-10-04 Thread Anton Shestakov
2010/10/4 Michael Bayer mike...@zzzcomputing.com: On Oct 4, 2010, at 1:34 AM, Anton Shestakov wrote: Hello all, So, here's simple script that produces the error: http://pastie.org/1197851 please take a look at it, the script isn't big at all and there's traceback for the error as well

[sqlalchemy] [sqlamp] released version 0.5.1

2009-11-29 Thread Anton Gritsay
Hi all, The sqlamp project gets a new release -- 0.5.1. The most important highlight is that it now supports polymorphic inheritance of nodes. It means that your trees can now contain objects of different types, provided that they all have one base class. sqlamp is an implementation of

[sqlalchemy] [sqlamp] Release 0.5 with ext.declarative support

2009-09-05 Thread Anton Gritsay
/#declarative -- Anton Gritsay, http://angri.ru --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Materialized Path for SQLAlchemy Declarative Base

2009-08-13 Thread Anton Gritsay
Hi, Allen! You can use something like this (yeah, I know that it isn't declarative in any way): class Node(Base): __tablename__ = 'node' id = Column(Integer, primary_key=True) parent_id = Column(ForeignKey('node.id')) parent = relation(Node,

[sqlalchemy] Re: Logging facilities of SQLAlchemy

2009-06-13 Thread Anton Gritsay
unfortunately the logging module included with Python adds significant performance overhead even if no handlers are configured.   We would like to be able to have fine-grained logging available in our library, but at the same time when the logging is disabled for significant latency to not

[sqlalchemy] Re: Caching

2007-12-22 Thread Anton V. Belyaev
merge is working rudimentally for objects with unloaded scalar/ instance/collection attributes in r3974. whats not yet happening is the merging of the various query.options() that may be present on the original deferred loader, which means the merged instance wont necessarily maintain the

[sqlalchemy] Re: Caching

2007-12-21 Thread Anton V. Belyaev
I rearranged instance-level deferred loaders to be serializable instances in r3968. you can now pickle an instance + its _state and restore, and all deferred/lazy loaders will be restored as well. I didnt yet test it specifically with merge() but give it a try, you shoudnt be getting that

[sqlalchemy] Re: Caching

2007-12-20 Thread Anton V. Belyaev
), Column('name', String(100)), Column('surname', String(100))) mapper(User, users, properties={ 'surname': deferred(users.c.surname) }) s = create_session() u = User() u.name = 'anton' u.surname = 'belyaev' s.save(u) s.flush() # now we need an instance

[sqlalchemy] Re: Caching

2007-12-20 Thread Anton V. Belyaev
pickle isnt going to work with deferred columns unless you implement __getstate__ and __setstate__. so the issue with session.merge() is just an extension of that issue, correct ? i.e. without deferreds merge has no issue. is it not reasonable to ask that objects which are to be

[sqlalchemy] Caching

2007-12-19 Thread Anton V. Belyaev
Hello, Several people already wrote something about memcached + SqlAlchemy. Remember, Mike Nelson wrote a mapper extention, it is available at: http://www.ajaxlive.com/repo/mcmapper.py http://www.ajaxlive.com/repo/mcache.py I've rewritten it a bit to fit 0.4 release of SA. Any response and

[sqlalchemy] Re: SA and MySQL replication.

2007-12-09 Thread Anton V. Belyaev
On Dec 6, 11:51 pm, Andrew Stromnov [EMAIL PROTECTED] wrote: I have DB with onemasterserver and several replicated slaves (MySQL). How to implement this functionality: read-only request can be passed to any DB (masterorslave), but any write request with following read requests must be sended

[sqlalchemy] Re: Unnecessary selects when cascade=all, delete-orphane and composite keys

2007-11-19 Thread Anton V. Belyaev
I am building a grading system for students and got unexpected performance problems. I am using composite key for marks, which refer to students and subjects. When I am creating a mark (for student_1 and subject_1), unnecessary select operations are performed (select all marks for

[sqlalchemy] Unnecessary selects when cascade=all, delete-orphane and composite keys

2007-11-18 Thread Anton V. Belyaev
Hello all, I am building a grading system for students and got unexpected performance problems. I am using composite key for marks, which refer to students and subjects. When I am creating a mark (for student_1 and subject_1), unnecessary select operations are performed (select all marks for

[sqlalchemy] SA does implicit cascading

2007-09-03 Thread Anton V. Belyaev
Hello, here is a sample: children_table = Table('children', metadata, Column('id', Integer, primary_key=True)) child2group_table = Table('child2group', metadata, Column('child_id', Integer, ForeignKey('children.id'),

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-25 Thread Anton V. Belyaev
t = Table('mytable', meta, Column(...) ) someothermeta = MetaData() t2 = Table('mytable', someothermetadata, autoload=True, autoload_with=connection) assert t.compare(t2) I believe this should be done somehow automatically. Because everyone needs this.

[sqlalchemy] Consistency with DB while modifying metadata

2007-07-24 Thread Anton V. Belyaev
Hey, I believe there is a common approach to the situation, but I just dont know it. Let say, I have some tables created in the DB using SQLAlchemy. Then I modify Python code, which describes the table (add a column, remove another column,...). What is the common way to handle this situation? I

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-24 Thread Anton V. Belyaev
On 24 июл, 17:34, svilen [EMAIL PROTECTED] wrote: On Tuesday 24 July 2007 16:22:43 Anton V. Belyaev wrote: Hey, I believe there is a common approach to the situation, but I just dont know it. Let say, I have some tables created in the DB using SQLAlchemy. Then I modify Python code