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.

New in version 3.28:

Methods

createLimitQueryForTable

Returns a result size limited SQL query string generated for the given schema and table name, retrieving all columns for the first limit rows.

quoteIdentifier

Returns a properly quoted version of a table/schema identifier.

createLimitQueryForTable(self, schema: str, name: str, limit: int = 10) str

Returns a result size limited SQL query string generated for the given schema and table name, retrieving all columns for the first limit 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 (str) –

  • name (str) –

  • limit (int = 10) –

Return type

str

quoteIdentifier(self, identifier: str) str

Returns a properly quoted version of a table/schema identifier.

Parameters

identifier (str) –

Return type

str