On Friday, September 23, 2011, 9:19:57 PM, Michael Bayer wrote:

> curious, is this for an alternate DBAPI implementation to an
> existing database, like "postgresql+somenewdriver://" ?  or
> multiple, alternate drivers for non-supported databases ? Can I
> get some specific examples?  its not clear how dialect+driver would
> map to an entrypoint.

specifically it is for alternate drivers for non-supported databases.
I try to update the ibm_db_sa to support SA 0.6/0.7 either
natively through ibm_db python DBAPI wrapper, PyODBC, or zxjdbc.
I also writing a new driver for DB2/400 through PyODBC, or zxjdbc.
My proposal is to enable any non-supported database configure the
connection url using the same pattern as on other supported database.
it is something like:

    def _load_entry_point(self):
        ....

        if '+' in self.drivername:
            _drivername = '.'.join(self.drivername.split('+'))
        else:
            _drivername = '.'.join([self.drivername, 'base'])

        for res in pkg_resources.iter_entry_points('sqlalchemy.dialects'):
            if res.name in (self.drivername, _drivername):
                return res.load()
        else:
            return None

so in entry_points the configuration would be:

[sqlalchemy.dialects]
ibm_db_sa = ibm_db_sa.base:dialect
ibm_db_sa.pyodbc = ibm_db_sa.pyodbc:dialect
ibm_db_sa.zxjdbc = ibm_db_sa.zxjdbc:dialect

-- 
Salam,

-Jaimy Azle

“+1 for stating fact: Perl is dead. Please 
    don't bring it back” – Matt Joiner
“-1 for spreading FUD about perl. It's 
    absolutely not dead.” – Daenyth
“+1 + -1 = 0, then, is perl a zombie?” – joaquin
    -- http://stackoverflow.com/questions/3384385/python-3-2-gil-good-bad

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
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