gws.base.database.manager

Core database utilities.

Source code: gws.base.database.manager

Module Contents

class gws.base.database.manager.Config(*args, **kwargs)

Bases: gws.Config

Database configuration

providers: list[gws.ext.config.databaseProvider]

Database providers.

class gws.base.database.manager.Object

Bases: gws.DatabaseManager

Database manager.

configure()

Configuration hook.

create_provider(cfg, **kwargs)

Create and return a DatabaseProvider instance based on the given configuration.

Parameters:
  • cfg – The configuration object for the database provider.

  • **kwargs – Additional keyword arguments to customize the provider creation.

Returns:

A new database provider instance.

Return type:

DatabaseProvider

enter_middleware(req: gws.WebRequester)

Begin middleware processing.

Parameters:

req – Requester object.

Returns:

A Responder object or None.

exit_middleware(req: gws.WebRequester, res: gws.WebResponder)

Finish middleware processing.

Parameters:
  • req – Requester object.

  • res – Current responder object.

find_provider(uid=None, ext_type=None)

Find and return a DatabaseProvider that matches the given UID and/or extension type.

Parameters:
  • uid – The unique identifier of the database provider to find.

  • ext_type – The type of the database provider to find.

Returns:

The matching database provider if found, otherwise None.