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¶
Base classes¶
Base class for the definition of processing parameters. |
Methods
Returns |
|
Returns the name of the parent connection parameter, or an empty string if this is not set. |
|
Returns the name of the parent schema parameter, or an empty string if this is not set. |
|
Sets whether the parameter allows users to enter names for a new (non-existing) tables. |
|
Sets the name of the parent connection parameter. |
|
Sets the name of the parent schema parameter. |
Static Methods
Creates a new parameter using the definition from a script code. |
|
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
connectionParameterNamespecifies the name of the parentQgsProcessingParameterProviderConnectionparameter. TheschemaParameterNamespecifies the name of the parentQgsProcessingParameterDatabaseSchemaparameter.Warning
The provider must support the connection API methods in its
QgsProviderMetadataimplementation 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:
- allowNewTableNames(self) bool[source]¶
Returns
Trueif the parameter allows users to enter names for a new (non-existing) tables.See also
- 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.
See also
- Return type:
str
- parentSchemaParameterName(self) str[source]¶
Returns the name of the parent schema parameter, or an empty string if this is not set.
See also
- Return type:
str
- setAllowNewTableNames(self, allowed: bool)[source]¶
Sets whether the parameter allows users to enter names for a new (non-existing) tables.
See also
- Parameters:
allowed (bool)
- setParentConnectionParameterName(self, name: str | None)[source]¶
Sets the
nameof the parent connection parameter. Use an empty string if this is not required.See also
- Parameters:
name (Optional[str])