[sqlalchemy] Re: How to find columns being updated/inserted given a Update/Insert object

2011-04-15 Thread empty
On Apr 15, 7:03 am, bool wrote: > Given an Update(or Insert) object how can I find the columns being > updated (or Inserted). > I dont find any function that gives these? > > t = Table("abc", MetaData(conn), Column("x", String), Column("y", > Integer)) > u = t.update().values(x='a') > > # Now I wa

[sqlalchemy] Re: How to find columns being updated/inserted given a Update/Insert object

2011-04-15 Thread empty
On Apr 15, 11:55 am, Michael Trier wrote: > > Given an Update(or Insert) object how can I find the columns being > > updated (or Inserted). > > I dont find any function that gives these? > > The attributes.get_history method will return this information to you as a > History record for each attrib

[sqlalchemy] Re: invalid transaction rollback etc and making a join join

2009-10-16 Thread empty
On Oct 15, 11:50 pm, Jeff Cook wrote: > > So, SQLAlchemy is doing something here. There probably is some > incorrect code in my program, which is why I am writing this list, to > figure out what that is. I'm an experienced developer and I don't > appreciate your disrespect. I can follow tutorials

[sqlalchemy] Re: MSSQL & default_schema

2008-12-23 Thread Empty
Rick, On Tue, Dec 23, 2008 at 10:32 AM, Rick Morrison wrote: > I've got a few concerns with the just-committed get_default_schema_name() > approach: > > 1) What about pre-2005 users? The query used in this patch to fetch the > schema name won't work. There was not even a real hard concept of 'sc

[sqlalchemy] Re: MSSQL & default_schema

2008-12-22 Thread Empty
On Mon, Dec 22, 2008 at 10:45 PM, Empty wrote: > On Mon, Dec 22, 2008 at 10:00 PM, Randall Smith wrote: > >> >> Michael Bayer wrote: >> >> >> Shouldn't mssql do something similar to Postgres here? >> > >> > it certainly should.

[sqlalchemy] Re: MSSQL & default_schema

2008-12-22 Thread Empty
On Mon, Dec 22, 2008 at 10:00 PM, Randall Smith wrote: > > Michael Bayer wrote: > > >> Shouldn't mssql do something similar to Postgres here? > > > > it certainly should. > > > > Ticket 1258 > Nice. Thank you very much. Michael --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: MSSQL & default_schema

2008-12-22 Thread Empty
On Mon, Dec 22, 2008 at 8:46 PM, Empty wrote: > >> On Dec 22, 2008, at 6:36 PM, Randall Smith wrote: >> >> > >> > Michael Bayer wrote: >> >> just FTR, the current expected behavior of default schemas is that if >> >> your tables are kno

[sqlalchemy] Re: MSSQL & default_schema

2008-12-22 Thread Empty
> > > On Dec 22, 2008, at 6:36 PM, Randall Smith wrote: > > > > > Michael Bayer wrote: > >> just FTR, the current expected behavior of default schemas is that if > >> your tables are known to exist in the default schema configured on > >> the > >> database connection, you leave the "schema" attribu

[sqlalchemy] Re: Create tables with metadata

2008-12-11 Thread Empty
Hi, On Thu, Dec 11, 2008 at 8:12 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > Hi > I've scoured the documentation and i can't find any info on how to > create a column using metadata. > > from sqlalchemy import engine > from sqlalchemy import schema > from sqlalchemy import types > > _co

[sqlalchemy] Re: Example of Using SQLAlchemy to Connect to Microsoft SQL Server 2005 via Trusted Connections

2008-12-09 Thread Empty
Hello, On Tue, Dec 9, 2008 at 9:19 AM, Keyton Weissinger <[EMAIL PROTECTED]> wrote: > > Greetings all. > > I'm new to sqlalchemy and would REALLY like to use it at my office. > I'm looking for examples and having a HECK of a time. > 1. Running Python 2.5.2 on Windows XP. > 2. Connecting to a loca

[sqlalchemy] Re: Column('last_updated', onupdate=func.current_timestamp())

2008-12-06 Thread Empty
> Column('last_updated', DateTime, PassiveDefault(func.current_timestamp > ()), onupdate=func.current_timestamp()) > > Maybe I don't understand how onupdate works. > I would like to have this column to be changed every time the row is > updated, > but it doesn't work. > I just use something like:

[sqlalchemy] Re: Insert.params() broken?

2008-11-20 Thread Empty
> Different, but related question: How do I print out the statement in > "copy-paste-able" format? More specifically, how do i get an ordered > list of bound values out of the statement? > > This code does what I want, but it's really clunky and fragile: > > def print_statement(stmt): >s = str(

[sqlalchemy] Re: Insert Column

2008-11-20 Thread Empty
en "a" and "b" column. > > One way to drop "b" column first then add "c" then again insert "b" > but that is not safe (if data not empty). Is there any Query in MS SQL > similar to MYSQL? > As far as I know you cannot purposefully

[sqlalchemy] Re: Vanilla parameterized query and results

2008-11-18 Thread Empty
Hi, On Tue, Nov 18, 2008 at 9:39 PM, TheShadow <[EMAIL PROTECTED]> wrote: > > All I need to be able to do is the following. (I don't need, can't > use, and/or don't want ORM) > > query = 'SELECT col FROM table where col = :col' > params = {'col':1} # and/or params = [{'col':1},{'col':2}] > OR > q

[sqlalchemy] Re: SQLAlchemy 0.5.0rc3 Released

2008-11-08 Thread empty
> there was another, which was the "ensure/insure" confusion.  J Ellis   > slapped me down a long time ago on that one and I've since stopped   > selling insurance. Found a few more and corrected. > > You consistently spell "propagate" as > > "propigate".   Is there any way we can get an i/a swi

[sqlalchemy] Re: mssql reflection fk issue

2008-11-08 Thread empty
> > When reflecting a MSSQL table with a foreign key, the referenced table > > fails to load with the error: > > > sqlalchemy.exc.NoSuchTableError: [referenced_table] > Give the latest trunk a try and let me know. It should have been corrected in r5266. Thanks, Michael --~--~-~--~~

[sqlalchemy] Re: from a db schema to sqlalchemy tables

2008-10-30 Thread Empty
There's this: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode Which will take the schema directly and create the classes. May not work for you. Michael On Thu, Oct 30, 2008 at 12:14 PM, Michele Simionato < [EMAIL PROTECTED]> wrote: > > Is there some utility to convert a schema file (o

[sqlalchemy] Re: minor documentation typo

2008-10-29 Thread empty
Jon, On Oct 27, 3:28 pm, Jon <[EMAIL PROTECTED]> wrote: > In the docs section for MetaData, under drop_all, the following text > appears: > >     Defaults to True, don't issue CREATEs for tables already present > in the target database. > > I think you mean s/CREATE/DROP/ This bit is corrected i

[sqlalchemy] Re: column name capitalization in mysql

2008-10-27 Thread Empty
Tom, On Mon, Oct 27, 2008 at 4:03 PM, Tom H <[EMAIL PROTECTED]> wrote: > > I'm experiencing the following problem with SA 0.4.7 > > The table has the following columns: > id - int primary key > DOB - varchar(25) > ... extra columns not needed for report > > It's a table from legacy app that I'm a

[sqlalchemy] Re: Missing 'match' documentation?

2008-10-20 Thread Empty
Hello, On Mon, Oct 20, 2008 at 10:10 AM, sandro dentella <[EMAIL PROTECTED]> wrote: > > Hi, > > I think I don't see documentation on the 'match' operator that works > differently according to db backend. Well it kind of didn't make sense to duplicate the individual database documentation on how

[sqlalchemy] Re: executemany upate

2008-10-18 Thread Empty
Hi, > Is there a way to do executemany() semantic updates? Suppose I have a list > of employee id's and I want to do something like: > > ids = [1, 2, 3, 4, 5, 6] > session.execute( tbl_employees.update(tbl_employees.c.id == ids), > tbl_employees.c.status="you're fired" ) Just us the in_ synta

[sqlalchemy] Re: how to query across all fields in an object?

2008-10-14 Thread Empty
Also, don't forget the match operator is available on certain backends: sqlite, sql server, oracle, mysql, and postgres. Michael On Tue, Oct 14, 2008 at 1:59 PM, <[EMAIL PROTECTED]> wrote: > > this is somewhat frequent question, lookup the group in the past if > anyone has something usable. > >

[sqlalchemy] Re: limit the set of returned columns

2008-10-07 Thread Empty
Hi, > Yesterday I was searching this group and the SA 5.0 doc to get something > working. Somewere I came across an option to specify the columnames to > return You can specify the column names as part of the query, like session.query(User.name, User.phone). > Filename, permissions

[sqlalchemy] Re: MSSQL Failing deletes with subquery + schema

2008-10-06 Thread Empty
Hi > Is there any chance someone can look at ticket 973? > http://www.sqlalchemy.org/trac/ticket/973 > > This is quite important to me, hitting the bug with a production app. > I've got a very hacky fix, which just disables the table aliasing, but > I don't think that's good enough to commit. I h

[sqlalchemy] Re: Declarative documentation

2008-09-17 Thread Empty
Hi Doug, > I'm a new user (like this week) of SqlAlchemy and I'm trying to find > more information about using the Declarative system. In particular I'm > trying to build a hierarchical table with one-to-many relationships > within the table. So if anyone knows where there might be some > additio

[sqlalchemy] Re: generative queries

2008-09-17 Thread Empty
Hello, > Im using 0.4.5, is this feature only available in 0.5? Yes, it's not available in 0.4.5. There is the predecessor _values available in 0.4.5. It was experimental and it's behavior has changed somewhat but will basically do the same thing. Michael > On Sep 16, 4:02 pm, Michael Bayer <

[sqlalchemy] Re: SQLAlchemy 0.5.0 Release Candidate 1 Released

2008-09-11 Thread empty
On Sep 11, 5:42 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > Hey list - > > I've just put out 0.5rc1.   This release is *great*, as I am using it   > heavily every day for a project here - it's got my personal seal of   > approval.  0.5 truly rocks in general.    In my particular   > applicatio

[sqlalchemy] Re: SqlAchemy and OpenOffice

2008-08-26 Thread Empty
> I have created a manual and give example on how to use sqlalchemy and > openoffice together to create documents. The code shows you how to use > openoffice as a document template and fill in the data from the > database. I basically use "Find and Replace" function of openoffice to > do the "temp

[sqlalchemy] Re: Query to get all items from a table which have no reference to another table?

2008-08-25 Thread Empty
Hello Felix, > No I want to get all items from table A where no matching item in table B > exists. I'm aware that this would be very easy if table A stores the > foreign key. SQLAlchemy supports the NOT EXISTS syntax through the any() / has() methods. You should be able to do something like thi

[sqlalchemy] Re: result as the dict()

2008-07-05 Thread Empty
Hi Russell, On Sun, Jul 6, 2008 at 12:32 AM, Russell Warren <[EMAIL PROTECTED]> wrote: > > I also had this issue and searched around for an answer, but found > nothing. In my case I;m using the orm and wanted to have those object > properties that map to a table be wrapped up in a dict. The new

[sqlalchemy] Re: Need help with the shard session and query get function

2008-07-05 Thread Empty
Jay, I looked at your code in detail and what I'm seeing is that the lookups are not even getting populated. It looks like there's no binding to an engine there, which points to a problem with your shard_chooser. What I would do is try to simplify it a bit. First realize that your lookup routi

[sqlalchemy] Query Clone Issue

2008-06-14 Thread empty
etime.now) def __repr__(self): return self.name Base.metadata.create_all() session.add_all([Category(name='zzeek'), Category(name='jek'), Category(name='empty')]) # order ascending c1 = session.query(Category).order_by(asc(Category

[sqlalchemy] Re: sqlalchemy 0.4.5 released

2008-04-07 Thread Empty
> > i.e. > > session.query([MappedObject.id, > > MappedObject.name]).filter(...).all() I actually thought of this mapping as well. Only because it seemed consistent with select. Granted I don't understand all the reasons why it could / could not work. That said I'm happy with value