Skip to content

Commit

Permalink
Add db url support for psycopg3.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Oct 10, 2024
1 parent fd5cabc commit 47e4276
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/peewee/playhouse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3482,12 +3482,16 @@ URL connection string.
Supported schemes:

* ``apsw``: :py:class:`APSWDatabase`
* ``cockroachdb``: :py:class:`CockroachDatabase`
* ``cockroachdb+pool``: :py:class:`PooledCockroachDatabase`
* ``mysql``: :py:class:`MySQLDatabase`
* ``mysql+pool``: :py:class:`PooledMySQLDatabase`
* ``postgres``: :py:class:`PostgresqlDatabase`
* ``postgres+pool``: :py:class:`PooledPostgresqlDatabase`
* ``postgresext``: :py:class:`PostgresqlExtDatabase`
* ``postgresext+pool``: :py:class:`PooledPostgresqlExtDatabase`
* ``psycopg3``: :py:class:`Psycopg3Database`
* ``psycopg3+pool``: :py:class:`PooledPsycopg3Database`
* ``sqlite``: :py:class:`SqliteDatabase`
* ``sqliteext``: :py:class:`SqliteExtDatabase`
* ``sqlite+pool``: :py:class:`PooledSqliteDatabase`
Expand Down
4 changes: 4 additions & 0 deletions playhouse/db_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
from playhouse.cockroachdb import PooledCockroachDatabase
from playhouse.pool import PooledMySQLDatabase
from playhouse.pool import PooledPostgresqlDatabase
from playhouse.pool import PooledPsycopg3Database
from playhouse.pool import PooledSqliteDatabase
from playhouse.pool import PooledSqliteExtDatabase
from playhouse.psycopg3_ext import Psycopg3Database
from playhouse.sqlite_ext import SqliteExtDatabase


Expand All @@ -24,6 +26,8 @@
'postgresql': PostgresqlDatabase,
'postgres+pool': PooledPostgresqlDatabase,
'postgresql+pool': PooledPostgresqlDatabase,
'psycopg3': Psycopg3Database,
'psycopg3+pool': PooledPsycopg3Database,
'sqlite': SqliteDatabase,
'sqliteext': SqliteExtDatabase,
'sqlite+pool': PooledSqliteDatabase,
Expand Down

0 comments on commit 47e4276

Please sign in to comment.