Class: QgsPostgresStringUtils

Provides functions to handle postgres array-like formatted lists in strings.

Added in version 3.8.

Static Methods

buildArray

Build a postgres array like formatted list in a string from a QVariantList

parseArray

Returns a QVariantList created out of a string containing an array in postgres array format {1,2,3} or {"a","b","c"}

class qgis.core.QgsPostgresStringUtils[source]

Bases: object

static buildArray(list: Iterable[Any]) str[source]

Build a postgres array like formatted list in a string from a QVariantList

Parameters:

list (Iterable[Any]) – The list that needs to be stored to the string

Added in version 3.8.

Return type:

str

static parseArray(string: str | None) List[Any][source]

Returns a QVariantList created out of a string containing an array in postgres array format {1,2,3} or {“a”,”b”,”c”}

Parameters:

string (Optional[str]) – The formatted list in a string

Added in version 3.8.

Return type:

List[Any]