25 QString QgsExecuteRegisteredSpatialiteQueryAlgorithm::name()
const
27 return QStringLiteral(
"spatialiteexecutesqlregistered" );
30 QString QgsExecuteRegisteredSpatialiteQueryAlgorithm::displayName()
const
32 return QObject::tr(
"SpatiaLite execute SQL (registered DB)" );
35 QStringList QgsExecuteRegisteredSpatialiteQueryAlgorithm::tags()
const
37 return QObject::tr(
"database,sql,spatialite,execute" ).split(
',' );
40 QString QgsExecuteRegisteredSpatialiteQueryAlgorithm::group()
const
42 return QObject::tr(
"Database" );
45 QString QgsExecuteRegisteredSpatialiteQueryAlgorithm::groupId()
const
47 return QStringLiteral(
"database" );
50 QString QgsExecuteRegisteredSpatialiteQueryAlgorithm::shortHelpString()
const
52 return QObject::tr(
"Executes a SQL command on a SpatiaLite database." );
55 QgsExecuteRegisteredSpatialiteQueryAlgorithm *QgsExecuteRegisteredSpatialiteQueryAlgorithm::createInstance()
const
57 return new QgsExecuteRegisteredSpatialiteQueryAlgorithm();
60 void QgsExecuteRegisteredSpatialiteQueryAlgorithm::initAlgorithm(
const QVariantMap & )
70 QString connName = parameterAsConnectionName( parameters, QStringLiteral(
"DATABASE" ), context );
72 std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn;
80 throw QgsProcessingException( QObject::tr(
"Could not retrieve connection details for %1" ).arg( connName ) );
83 QString sql = parameterAsString( parameters, QStringLiteral(
"SQL" ), context ).replace(
'\n',
' ' );
86 conn->executeSql( sql );
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
A data provider connection parameter for processing algorithms, allowing users to select from availab...
A string parameter for processing algorithms.
Custom exception class for provider connection related exceptions.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
QgsProviderMetadata * providerMetadata(const QString &providerKey) const
Returns metadata of the provider or nullptr if not found.