Module z_db_pool

Database pool wrapper.

Copyright © 2014-2020 Arjan Scherpenisse

Authors: Arjan Scherpenisse (arjan@scherpenisse.net).

Description

Database pool wrapper

Function Index

child_spec/2Optionally add the db pool connection.
close_connections/0
close_connections/1
database_options/2Merge the database options from the global config into the site config.
database_options/3
db_driver/1
db_driver_default/0
db_pool_name/1
get_connection/1
get_database_options/1Get all configuration options for this site which are related to the database configuration.
return_connection/2
status/0
status/1
test_connection/1
test_connection/2Perform a connect to test if the database is working.

Function Details

child_spec/2

child_spec(Site, SiteProps) -> any()

Optionally add the db pool connection

close_connections/0

close_connections() -> any()

close_connections/1

close_connections(Context) -> any()

database_options/2

database_options(Sitename::atom(), SiteProps::proplists:proplist()) -> proplists:proplist()

Merge the database options from the global config into the site config. If the site uses the default database and it has no schema defined then the site's name is used as the schema name. If the site uses its own database then the schema defaults to "public".

database_options/3

database_options(Sitename::atom(), SiteProps::proplists:proplist(), GlobalProps::proplists:proplist()) -> proplists:proplist()

db_driver/1

db_driver(SiteProps) -> any()

db_driver_default/0

db_driver_default() -> any()

db_pool_name/1

db_pool_name(Site) -> any()

get_connection/1

get_connection(Context::z:context()) -> {ok, pid()} | {error, full | nodatabase}

get_database_options/1

get_database_options(Context::z:context()) -> proplists:proplist()

Get all configuration options for this site which are related to the database configuration.

return_connection/2

return_connection(Worker::pid(), Context::z:context()) -> ok | {error, term()}

status/0

status() -> any()

status/1

status(Context) -> any()

test_connection/1

test_connection(Context::z:context()) -> ok | {error, nodatabase | noschema | term()}

test_connection/2

test_connection(Site::atom(), SiteProps::proplists:proplist()) -> ok | {error, nodatabase | noschema | term()}

Perform a connect to test if the database is working.


Generated by EDoc