gws.plugin.postgres.storage_provider

Postgres storage provider.

Source code: gws.plugin.postgres.storage_provider

Module Contents

class gws.plugin.postgres.storage_provider.Config(*args, **kwargs)

Bases: gws.Config

Postgres storage provider. (added in 8.4)

dbUid: str | None

Database provider uid.

tableName: str

Table name for the storage.

class gws.plugin.postgres.storage_provider.Object

Bases: gws.StorageProvider

Storage provider.

db: gws.plugin.postgres.provider.Object
tableName: str
configure()

Configuration hook.

configure_provider()
configure_table()
delete(category, name)
list_names(category)
read(category, name)
write(category, name, data, user_uid)
gws.plugin.postgres.storage_provider.TABLE_DDL = Multiline-String
Show Value
"""
    CREATE TABLE IF NOT EXISTS {table_name} (
        category    TEXT NOT NULL,
        name        TEXT NOT NULL,
        user_uid    TEXT,
        data        TEXT,
        created     TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
        updated     TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
        PRIMARY KEY (category, name)
    )
"""