What is the native Python support for database manipulation?

4

I found things about a module called mysqldb, but I did not find documentation available at docs.python.org

Please disregard responding with frameworks such as Django.

    
asked by anonymous 28.06.2017 / 06:29

2 answers

4

Set native. If you are talking about the default library only SQLite is available .

If you are talking about extra modules available for direct access in the most crude API of the database there is a non-definitive list in the Wiki :

Note the existence of more than one option.

There are non-relational options and even what they call native which seems to me to be Python-developed banks exclusively for use with the language.

I am particularly like the AP, I prefer the most basic support, any extra abstraction, like the framework SQLAlchemy, I'd rather not use it unless the problem even asks for it, which is rare technically, this is usually "political" decision.

    
28.06.2017 / 12:10
2

In my opinion, in languages that support the OO paradigm, it is far more productive to use an ORM (when available) for relational database access. In the case of python, if I'm not using a framework that uses its own ORM, such as Django, for example (I even regret Django did not elect SQLAlchemy as official ORM), I always opt for sqlalchemy .

SQLAlchemy , is, to me, the "native support" of relational database access in python (of course I'm exaggerating to emphasize the importance of the toolkit).

See, on the project page, who uses SQLAlchemy: Yelp, The Open Stack Project, Reddit, Mozilla, Dropobx, Fedora, Freshbook, and ... by ai vai.

Dialects supported (not core):

  • Firebird
  • Microsoft SQL Server
  • MySQL
  • Oracle
  • PostgreSQL
  • SQLite
  • Sybase

Dialects supported by third parties:

  • ibm_db_sa - driver for IBM DB2 and Informix, developed jointly by IBM and SQLAlchemy developers.
  • sqlalchemy-redshift - driver for Amazon Redshift, adapts the existing PostgreSQL / psycopg2 driver.
  • sqlalchemy_exasol - driver for EXASolution.
  • sqlalchemy-sqlany - driver for Sybase SQL Anywhere, developed by SAP.
  • sqlalchemy-monetdb - driver for MonetDB.
  • snowflake-sqlalchemy - driver for Snowflake.
  • sqlalchemy-tds - driver for MS-SQL, on top of pythone-tds.
  • crate - driver for CrateDB.
28.06.2017 / 15:06