[sqlalchemy] Re: Slow running

2010-02-25 Thread dusans
News has a TEXT column [content] which is in average about 5000 in length. So ye, u found the problem :) And how to overcome (workaround) this in sqlalchemy? On 25 feb., 00:42, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 24, 2010, at 6:15 PM, dusans wrote: Hi. I got this simple

[sqlalchemy] Re: Slow running

2010-02-25 Thread dusans
I've profile it 1. Session.query: 2.8 seconds 2. Session.execute: 2.6 seconds 3. sqlite.execute: 2.6 seconds 4. If u run it directly via Sqlite Gui client (SQLite Expert) then i get: 50 ms Maybe its using some kind of cache. On 25 feb., 00:42, Michael Bayer mike...@zzzcomputing.com

[sqlalchemy] Constructors and Object Initialization...

2010-02-25 Thread f3d
Hello, Guess I haven't understood all the magic behind object mapping... I have a class like this : class MyClass(object): __init__(self, name): self = session.query(MyClass).filter(MyClass.name==name).one() print self.name # Outputs 'joe' And I'm expecting that my

Re: [sqlalchemy] Re: Slow running

2010-02-25 Thread Michael Bayer
you can skip the loading of that column using deferred(), for example. still, 5000 * 8 is only 40K. should be well under 200 ms. On Feb 25, 2010, at 4:10 AM, dusans wrote: News has a TEXT column [content] which is in average about 5000 in length. So ye, u found the problem :) And how to

Re: [sqlalchemy] Constructors and Object Initialization...

2010-02-25 Thread Michael Bayer
On Feb 24, 2010, at 7:59 PM, f3d wrote: Hello, Guess I haven't understood all the magic behind object mapping... I have a class like this : class MyClass(object): __init__(self, name): self = session.query(MyClass).filter(MyClass.name==name).one() print

[sqlalchemy] assert_unicode=True

2010-02-25 Thread Marcin Krol
Hello everyone, To refresh my familiarity with SQLAlchemy I wrote a sample app, and used: engine = create_engine(postgres://postgres:*...@localhost/ts, convert_unicode=True, assert_unicode=True) Then I passed a few strings in an object added via session.add() and one of those strings was

Re: [sqlalchemy] assert_unicode=True

2010-02-25 Thread Antoine Pitrou
Le Thu, 25 Feb 2010 21:44:51 +0100, Marcin Krol mrk...@gmail.com a écrit : SAWarning: Unicode type received non-unicode bind param value 'Jane Shmoe' param[key.encode(encoding)] = processors[key](compiled_params[key]) [...] I would need this to be error rather than warning just like docs

Re: [sqlalchemy] assert_unicode=True

2010-02-25 Thread Michael Bayer
Marcin Krol wrote: Hello everyone, To refresh my familiarity with SQLAlchemy I wrote a sample app, and used: engine = create_engine(postgres://postgres:*...@localhost/ts, convert_unicode=True, assert_unicode=True) Then I passed a few strings in an object added via session.add() and one

[sqlalchemy] Re: Getting useful error messages

2010-02-25 Thread Hollister
Ok...maybe I'm missing something, but why wasn't that raised in this case instead of the rather cryptic exception? On Feb 18, 4:59 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 18, 2010, at 1:16 PM, Hollister wrote: I ran into this also and it was caused by forgetting to map the

Re: [sqlalchemy] Re: Getting useful error messages

2010-02-25 Thread Michael Bayer
Hollister wrote: Ok...maybe I'm missing something, but why wasn't that raised in this case instead of the rather cryptic exception? I'm looking back and I don't see that we've established specifically what this case is. Would need to see that in order to investigate. On Feb 18, 4:59 pm,

Re: [sqlalchemy] another problem with complex join

2010-02-25 Thread Michael Bayer
Manlio Perillo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Bayer ha scritto: On Feb 18, 2010, at 11:55 AM, Manlio Perillo wrote: Michael Bayer ha scritto: [...] so what I had in mind is that, if its given a join as the left side, it just does the natural thing, i.e.

[sqlalchemy] sqlalchemy 6beta1 error

2010-02-25 Thread karikris...@gmail.com
I could not get from sqlalchemy.databases.mysql import MSBinary working on my windows XP as well as my Ubuntu 32 and 64 bit machines. Are they dropped? Here are summary ActivePython 2.6.0.0 (ActiveState Software Inc.) based on Python 2.6 (r26:66714, Nov 11 2008, 10:21:19) [MSC v.1500 32 bit