AKM
AKM

Reputation: 6555

Using Mysql and sql server from python

I need to write a python application with use both of the mysql and sql server is there a general python module or library that can access both mysql and sql server as DBI with perl or should i use 2 libraries and if yes which libraries do you recommend .

Upvotes: 0

Views: 1633

Answers (3)

igor
igor

Reputation: 2100

I guess you are looking for SQLAlchemy. You will probably need some time getting into it, but it is invaluable once you have covered the basics.

SQLAlchemy acts as a frontend to other, database-specific libraries using the Python DB-API -- but beyond this, it provides a query builder library that abstracts out differences between databases' SQL syntax and permits programmatic query construction while still offering the full power of SQL.

Upvotes: 3

Mark
Mark

Reputation: 108537

If you are looking for which connection drivers to use, I believe the only one that well work for both [MySQL (driver here) and SQLServer (native to windows/FreeTDS for linux) is pyodbc. @igor has the right idea, though, use SQLAlchemy, you can connect to each database using different engines, but use the same code to interact with both.

Upvotes: 0

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798706

Python RDBMS modules implement DB-API.

Upvotes: 0

Related Questions