Skip to main content

PonyORM Database object Facade

Project description

Latest Version Apache 2.0 STARS

PonyORM Database object Facade. The package encapsulates the names of the parameters used in the low-level modules.

Русская документация


pip install pony-database-facade


The DatabaseFacade constructor and the bind method takes the following arguments:

The name of the database provider. One of the list: sqlite, mysql, postgres or oracle. By default is sqlite.
The name of the database. If you are using SQLite, the name of the file in which SQLite will store the data and by default is :memory:.
Name of host to connect to. By default is localhost.
TCP port of database server. By default is standard port.
User to authenticate as. By default is None.
Password to authenticate with. By default is None.
charset (MySQL only)
By default is utf8.
create_db (SQLite only)
Try to create the database if such filename doesn’t exists. By default is True.
parameters required by the database driver.
parameters required by the database driver.
# SQLite in memory
db = DatabaseFacade()

# MySQL, localhost, no user, no password, used database blog
db = DatabaseFacade('mysql', dbname='blog')
db = DatabaseFacade(provider='mysql', dbname='blog')

# PostgreSQL
db = DatabaseFacade()


To connect to the database, use the connect method. This method takes the same arguments as generate_mapping, but the default for create_tables is True. This method also calls the bind method.

db = DatabaseFacade()

Full example

from pony.orm import Required, db_session, show
from pony_database_facade import DatabaseFacade

db = DatabaseFacade()

class Person(db.Entity):
    username = Required(str, 50)


with db_session:
    person_1 = Person(username='Linus')


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pony-database-facade, version 2.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pony-database-facade-2.0.1.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page