What is Python’s native support for database manipulation?

Asked

Viewed 742 times

4

I found things about a module called mysqldb, but I couldn’t find documentation available on Docs.python.org

Please disregard responding with frameworks such as Django.

2 answers

4


Set native. If you are speaking from the standard library only Sqlite is available.

If you are talking about extra modules available for direct access in the most raw API possible from the database there is a no definitive list on 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 databases developed in Python exclusively for use with the language.

Particularly I’m like AP, I prefer the most basic support, any extra abstraction, like the framework Sqlalchemy, I prefer not to use unless the problem asks even for it, which is rare technically, in general this is "political decision".

2

In my opinion, in languages that support the OO paradigm, it is much more productive to use a ORM (when available) for access to relational banks. In the case of python, if I’m not using a Framework that uses its own ORM, like Django, for example (including, I’m sorry Django didn’t elect Sqlalchemy as the official ORM), I always opt for sqlalchemy.

Sqlalchemy, is, for me, the "native support" of access to relational databases in python (of course I’m exaggerating to emphasize the importance of Toolkit).

See, on the project page, who uses Sqlalchemy: Yelp, The Open Stack Project, Reddit, Mozilla, Dropobx, Fedora, Freshbook, and... so on and so forth.

Supported dialects (in 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 SAP 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.
  • Interesting. Thank you. ps: by native, I meant that it already comes with the language (built-in), in the core of the language. In the case of python, it would be a module. Thanks!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.