I'm new to Python and am trying to get a sense of SQLAlchemy,
particularly how to get it to work with our database infrastructure.
I followed the Shard tutorial but didn't find it helpful for a
beginner switching to this infrastructure.

We have a central database that stores the locations of our shards.  I
would like to create a class that initiates a connection to the
Central database only when necessary.  As well as one that connects
directly to a specific shard when supplied with an id.

For example:

class Central():

    def __init__(self):

        //Connect to Central DB


class Shard():
    def __init__(self,id):

        //Connect to Central DB and fetch the connection info for the
shard that contains user with id

        //Connect to that shard


What is the proper way of doing something like this?  Any sample code
is greatly appreciated.  Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to