gws.plugin.postgres.finder

PostgreSQL finder.

Source code: gws.plugin.postgres.finder

Module Contents

class gws.plugin.postgres.finder.Config

Bases: gws.base.search.finder.Config

Search in a PostgreSQL table.

dbUid: str | None

UID of the database provider.

sqlFilter: str | None

SQL condition added to all search queries.

tableName: str

Table to search, optionally schema-qualified.

class gws.plugin.postgres.finder.Object

Bases: gws.base.search.finder.Object

Finder that searches a PostgreSQL table through its postgres models.

db: gws.DatabaseProvider

Database provider.

tableName: str

Table to search.

configure()
configure_models()
configure_provider()

Set the database provider from dbUid, or the first postgres provider.

Returns:

True if a provider was set.

Raises:

gws.Error – If no provider is found.

create_model(cfg)

Create a postgres model for the table of the finder.

The model gets the database provider, the table and the sqlFilter of the finder.

Parameters:

cfg – Model configuration, or None for the default model.

Returns:

The model object.