On Sep 23, 2011, at 11:08 AM, Jaimy Azle wrote: > 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:
please review the patch at http://www.sqlalchemy.org/trac/ticket/2286 - first if the general idea works, and second that there are no mistakes (I haven't tested it). The "+" is simply changed to a ".", and also package-installed drivers on top of existing dialects is supported. I don't see the need to substitute "base" if the entrypoints are like that below: [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 > > 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 sqlalchemy@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. > -- 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 sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.