Skip to content

Commit

Permalink
Add docs clarifying compatibility with MariaDB
Browse files Browse the repository at this point in the history
Peewee is compatible with MariaDB Server. Add clarifying notes in the
documentation, including logo, etc.

Testing
```
docker run -d -p 3306:3306 --name mariadb_container -e MYSQL_ROOT_PASSWORD=password mariadb
```

```
>>> from peewee import MySQLDatabase
>>> database = MySQLDatabase('information_schema', user='root', password='password', host='127.0.0.1', port=3306)
>>> database.connect()
True
>>> version_query = database.execute_sql('SELECT VERSION()')
>>> print(version_query.fetchone()[0])
11.3.2-MariaDB-1:11.3.2+maria~ubu2204
>>> database.close()
True
```
  • Loading branch information
robinnewhouse committed Mar 14, 2024
1 parent 4d177b7 commit 0b978aa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Peewee is a simple and small ORM. It has few (but expressive) concepts, making i

* a small, expressive ORM
* python 2.7+ and 3.4+
* supports sqlite, mysql, postgresql and cockroachdb
* supports sqlite, mysql, mariadb, postgresql and cockroachdb
* tons of `extensions <http://docs.peewee-orm.com/en/latest/peewee/playhouse.html>`_

New to peewee? These may help:
Expand Down
6 changes: 5 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ it easy to learn and intuitive to use.

* a small, expressive ORM
* python 2.7+ and 3.4+
* supports sqlite, mysql, postgresql and cockroachdb
* supports sqlite, mysql, mariadb, postgresql and cockroachdb
* :ref:`tons of extensions <playhouse>`

.. image:: postgresql.png
Expand All @@ -24,6 +24,10 @@ it easy to learn and intuitive to use.
:target: peewee/database.html#using-mysql
:alt: mysql

.. image:: mariadb.png
:target: peewee/database.html#using-mariadb
:alt: mariadb

.. image:: sqlite.png
:target: peewee/database.html#using-sqlite
:alt: sqlite
Expand Down
Binary file added docs/mariadb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 15 additions & 7 deletions docs/peewee/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ to open a connection to a database, and then can be used to:
* Manage transactions (and savepoints).
* Introspect tables, columns, indexes, and constraints.

Peewee comes with support for SQLite, MySQL and Postgres. Each database class
provides some basic, database-specific configuration options.
Peewee comes with support for SQLite, MySQL, MariaDB and Postgres. Each
database class provides some basic, database-specific configuration options.

.. code-block:: python
Expand Down Expand Up @@ -557,6 +557,14 @@ If you would like to use APSW, use the :py:class:`APSWDatabase` from the
apsw_db = APSWDatabase('my_app.db')
.. _using_mariadb:

Using MariaDB
-----------

Peewee supports MariaDB. To use MariaDB, use the MySQL backend, which is shared
between the two. See :ref:`"Using MySQL" <using_mysql>` for more details.

.. _using_mysql:

Using MySQL
Expand Down Expand Up @@ -1773,11 +1781,11 @@ handler.
Adding a new Database Driver
----------------------------

Peewee comes with built-in support for Postgres, MySQL and SQLite. These
databases are very popular and run the gamut from fast, embeddable databases to
heavyweight servers suitable for large-scale deployments. That being said,
there are a ton of cool databases out there and adding support for your
database-of-choice should be really easy, provided the driver supports the
Peewee comes with built-in support for Postgres, MySQL, MariaDB and SQLite.
These databases are very popular and run the gamut from fast, embeddable
databases to heavyweight servers suitable for large-scale deployments. That
being said, there are a ton of cool databases out there and adding support for
your database-of-choice should be really easy, provided the driver supports the
`DB-API 2.0 spec <http://www.python.org/dev/peps/pep-0249/>`_.

.. warning::
Expand Down

0 comments on commit 0b978aa

Please sign in to comment.