Use With zodburi#
This package also enable the use of the postgres://
, mysql://
and oracle://
URI schemes for zodburi.
For more information about zodburi, please refer to its documentation. This
section contains information specific to the these schemes.
URI schemes#
The postgres://
, mysql://
, oracle://
and sqlite://
URI schemes can
be passed as zodbconn.uri
to create a RelStorage PostgresSQL,
MySQL or Oracle database factory. The uri should contain the user,
the password, the host, the port and the db name e.g.:
postgres://someuser:somepass@somehost:5432/somedb?connection_cache_size=20000
mysql://someuser:somepass@somehost:5432/somedb?connection_cache_size=20000
Because oracle connection information are most often given as dsn, the oracle uri should not contain the same information as the other, but only the dsn
oracle://?dsn="HERE GOES THE DSN"
Likewise, SQLite only needs the path to the directory to hold the files:
sqlite://?data_dir=/the/path/to/database
Query String Arguments#
The URI scheme also accepts query string arguments. The query string arguments honored by this scheme are as follows.
Usual zodburi arguments#
Arguments that are usual with zodburi are also available here (see http://docs.pylonsproject.org/projects/zodburi/en/latest/) :
- demostorage
boolean (if true, wrap RelStorage in a DemoStorage)
- database_name
string
- connection_cache_size
integer (default 10000)
- connection_pool_size
integer (default 7)
Postgres specific#
- connection_timeout
integer
- ssl_mode
string
Mysql specific#
- connection_timeout
integer
- client_flag
integer
- load_infile
integer
- compress
boolean
- named_pipe
boolean
- unix_socket
string
- init_command
string
- read_default_file
string
- read_default_group
string
Oracle specific#
- twophase
integer
- user
string
- password
string
- dsn
string
Example#
An example that combines a path with a query string:
postgres://someuser:somepass@somehost:5432/somedb?connection_cache_size=20000