> How would I connect to a local MySQL database? The database I'm
> working with is already designed and built, which leads me onto my
> next question:

Ok, I've figured that one out for myself which is a good start. However,
I've been getting the following error when trying to do things with the
session.

"AttributeError: 'Sess' object has no attribute 'add'"

I'm creating the session like so:

engine = create_engine("mysql://root:[EMAIL PROTECTED]/thinkblue", echo=True)
Session = sessionmaker(bind=engine)
my_session = Session()

Have I got that correct?

> In the tutorial documentation it talks about 'Defining and Creating a
> Table'. Is this something which need only be done when we're working
> with an in-memory database? or do I have to define my database schema
> even if its a pre-existing mysql database? or does SQLAlchemy
> introspect it or something?

Also now realize that I don't have to do this, so long as I declare these
things at the top of the class which I'm looking to save, using the
declarative base method :-D

> My thrid and final question is about the persistance of composed
> objects. If I save an object using sql alchamy, I see it also saves
> the objects children. Is this done in a transaction by default? if the
> save process on one of its children fails will it all be rolled back?
> or is this something I have to specify seperatly?

I could still use some advice on this.


--~--~---------~--~----~------------~-------~--~----~
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