Class: QgsProviderSqlQueryBuilder¶
- class qgis.core.QgsProviderSqlQueryBuilder¶
Bases:
sip.wrapper
Provides an interface for provider-specific creation of SQL queries.
The
QgsProviderSqlQueryBuilder
provides an interface for creation of SQL queries, which can be overridden for backend provider specific SQL syntax.Added in version 3.28:
Methods
Returns a result size limited SQL query string generated for the given
schema
and tablename
, retrieving all columns for the firstlimit
rows.Returns a properly quoted version of a table/schema
identifier
.- createLimitQueryForTable(self, schema: str | None, name: str | None, limit: int = 10) str ¶
Returns a result size limited SQL query string generated for the given
schema
and tablename
, retrieving all columns for the firstlimit
rows.The base class method returns the SQL query “SELECT * FROM table LIMIT 10”. Subclasses may return database specific equivalents to this query.
- Parameters:
schema (Optional[str])
name (Optional[str])
limit (int = 10)
- Return type:
str
- quoteIdentifier(self, identifier: str | None) str ¶
Returns a properly quoted version of a table/schema
identifier
.- Parameters:
identifier (Optional[str])
- Return type:
str