> > db = SQLAlchemyFixture()
> > # anytime before db.data().setup() ...
> > db.session = my_session
>
> In my current system I have a single global session that is used for
> everything.  Is there any reason you can see that I could not just
> reuse this session in all the test cases or should I be creating a new
> on each time?

Are you using postgres?  The only problem I foresee is if your test
does some work with table instances shared by the fixtures but doesn't
explicitly call rollback when there is an exception.  You will
probably even get a deadlock if that happens.  `ps aux | grep
postgres` will show if a fixture's delete statement is waiting on
another transaction.  I've tried to accomodate for this scenario so
let me know if you run into it again so I can add some tests for it.


> The other thing you lose with an SQL dump is that the output may not
> work across different database backends.  That is why I would really
> like the loading of the table to be routed back through SA so we can
> have some support for moving the testing data to whatever db's you end
> up needed.  (in my particular case this isn't really going to work
> because I need GIS support which is non portable, but it sounds like a
> nice capability to me)
>

agreed.  I'm not entirely convinced that XML is the way to go, but
this makes sense (and I like the plugin idea).  It would be mighty
fast with lxml.etree.iterparse().  still thinking...

> ...and points out a problem I am going to
> have using it.  In my current code I am not keeping the tables or
> mappers around.  Instead I have a database manager class that sets
> everthing up and simply holds onto the session and engine that should
> be used to query the database.  I rely upon the mapped classes to keep
> track of the table and metadata references internally.
>
> So... is there any way to associated a dataset with the Class type
> that is associated with the data in the dataset?
>
> for example maybe something like:
>
> class anything_I_want(DataSet):
>    mappedType = MyDataClass
>    class click:
>       name="click"
>
> or something else along these lines.  This seems like it would work
> well to tie the data back to the class type that is actually being
> mapped.  Then the "anything_I_want" class is really just a list of
> MyDataClass objects that need to be populated into the database.

Yes, I've made an attempt to support mapped classes but there are many
different ways to map classes so I might not have captured them all.
Please try:

class anything_i_want(DataSet):
    class Meta:
        storable=MyDataClass
    class click:
        name="click"

and let me know if that doesn't work, so I can get an idea for how you
are using mapped classes.


-Kumar

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to