Class: QgsProcessingParameterDatabaseTable

A database table name parameter for processing algorithms.

This parameter allows users to select from existing database tables on a registered database connection (or optionally to enter a new table name).

QgsProcessingParameterDatabaseTable should be evaluated by calling QgsProcessingAlgorithm.parameterAsDatabaseTableName().

Added in version 3.14.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingParameterDatabaseTable

Base classes

QgsProcessingParameterDefinition

Base class for the definition of processing parameters.

Methods

allowNewTableNames

Returns True if the parameter allows users to enter names for a new (non-existing) tables.

parentConnectionParameterName

Returns the name of the parent connection parameter, or an empty string if this is not set.

parentSchemaParameterName

Returns the name of the parent schema parameter, or an empty string if this is not set.

setAllowNewTableNames

Sets whether the parameter allows users to enter names for a new (non-existing) tables.

setParentConnectionParameterName

Sets the name of the parent connection parameter.

setParentSchemaParameterName

Sets the name of the parent schema parameter.

Static Methods

fromScriptCode

Creates a new parameter using the definition from a script code.

typeName

Returns the type name for the parameter class.

class qgis.core.QgsProcessingParameterDatabaseTable[source]

Bases: QgsProcessingParameterDefinition

__init__(name: str | None, description: str | None, connectionParameterName: str | None = '', schemaParameterName: str | None = '', defaultValue: Any = None, optional: bool = False, allowNewTableNames: bool = False)

Constructor for QgsProcessingParameterDatabaseTable.

The connectionParameterName specifies the name of the parent QgsProcessingParameterProviderConnection parameter. The schemaParameterName specifies the name of the parent QgsProcessingParameterDatabaseSchema parameter.

Warning

The provider must support the connection API methods in its QgsProviderMetadata implementation in order for the model to work correctly. This is only implemented for a subset of current data providers.

Parameters:
  • name (Optional[str])

  • description (Optional[str])

  • connectionParameterName (Optional[str] = '')

  • schemaParameterName (Optional[str] = '')

  • defaultValue (Any = None)

  • optional (bool = False)

  • allowNewTableNames (bool = False)

__init__(a0: QgsProcessingParameterDatabaseTable)
Parameters:

a0 (QgsProcessingParameterDatabaseTable)

allowNewTableNames(self) bool[source]

Returns True if the parameter allows users to enter names for a new (non-existing) tables.

Return type:

bool

static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterDatabaseTable | None[source]

Creates a new parameter using the definition from a script code.

Parameters:
  • name (Optional[str])

  • description (Optional[str])

  • isOptional (bool)

  • definition (Optional[str])

Return type:

Optional[QgsProcessingParameterDatabaseTable]

parentConnectionParameterName(self) str[source]

Returns the name of the parent connection parameter, or an empty string if this is not set.

Return type:

str

parentSchemaParameterName(self) str[source]

Returns the name of the parent schema parameter, or an empty string if this is not set.

Return type:

str

setAllowNewTableNames(self, allowed: bool)[source]

Sets whether the parameter allows users to enter names for a new (non-existing) tables.

Parameters:

allowed (bool)

setParentConnectionParameterName(self, name: str | None)[source]

Sets the name of the parent connection parameter. Use an empty string if this is not required.

Parameters:

name (Optional[str])

setParentSchemaParameterName(self, name: str | None)[source]

Sets the name of the parent schema parameter. Use an empty string if this is not required.

Parameters:

name (Optional[str])

static typeName() str[source]

Returns the type name for the parameter class.

Return type:

str