mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
This is a temporary solution for OGR because we expect to use the native GDAL implementation in GDAL 3.2. For now a new method QgsSqliteUtils::uniqueFields used by spatialite and OGR/GPKG is used to detect UNIQUE constraints on single fields.
79 lines
2.3 KiB
Plaintext
79 lines
2.3 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgssqliteutils.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsSqliteUtils
|
|
{
|
|
%Docstring
|
|
Contains utilities for working with Sqlite data sources.
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgssqliteutils.h"
|
|
%End
|
|
public:
|
|
|
|
static QString quotedString( const QString &value );
|
|
%Docstring
|
|
Returns a quoted string ``value``, surround by ' characters and with special
|
|
characters correctly escaped.
|
|
%End
|
|
|
|
static QString quotedIdentifier( const QString &identifier );
|
|
%Docstring
|
|
Returns a properly quoted version of ``identifier``.
|
|
|
|
.. versionadded:: 3.6
|
|
%End
|
|
|
|
static QString quotedValue( const QVariant &value );
|
|
%Docstring
|
|
Returns a properly quoted and escaped version of ``value``
|
|
for use in SQL strings.
|
|
|
|
.. versionadded:: 3.6
|
|
%End
|
|
|
|
static QStringList systemTables();
|
|
%Docstring
|
|
Returns a string list of SQLite (and spatialite) system tables
|
|
|
|
.. versionadded:: 3.8
|
|
%End
|
|
|
|
static QSet<QString> uniqueFields( sqlite3 *connection, const QString &tableName, QString &errorMessage );
|
|
%Docstring
|
|
Returns a list of field names for ``connection`` and ``tableName`` having a UNIQUE constraint,
|
|
fields that are part of a UNIQUE constraint that spans over multiple fields
|
|
are not returned.
|
|
|
|
.. note::
|
|
|
|
the implementation is the same of GDAL but the test coverage is much
|
|
better in GDAL.
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgssqliteutils.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|