Gjsify LogoGjsify Logo

Index

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

SqlBuilderId: number

Variables

ATTRIBUTE_AUTO_INCREMENT: string

The corresponding attribute specifies if the object it refers to is auto incremented (value has a G_TYPE_BOOLEAN type).

ATTRIBUTE_DESCRIPTION: string

The corresponding attribute is the description of the object it refers to (value has a G_TYPE_STRING type).

ATTRIBUTE_IS_DEFAULT: string

The corresponding attribute specifies if the object it refers to has its value to default (value has a G_TYPE_BOOLEAN type).

ATTRIBUTE_NAME: string

The corresponding attribute is the name of the object it refers to (value has a G_TYPE_STRING type).

ATTRIBUTE_NUMERIC_PRECISION: string

The corresponding attribute is the number of significant digits of the object it refers to (value has a G_TYPE_INT type).

ATTRIBUTE_NUMERIC_SCALE: string

The corresponding attribute is the number of significant digits to the right of the decimal point of the object it refers to (value has a G_TYPE_INT type).

ATTRIBUTE_TREE_NODE_UNKNOWN_CHILDREN: string

This attribute, if %TRUE specifies that a tree node may or may not have any children nodes (value has a G_TYPE_BOOLEAN type).

EXTRA_AUTO_INCREMENT: string
SQLSTATE_GENERAL_ERROR: string
SQLSTATE_NO_ERROR: string
TIMEZONE_INVALID: number

Functions

  • alphanumToText(text: string): string | null
  • Does the opposite of gda_text_to_alphanum(), in the same string

    Parameters

    • text: string

      a string

    Returns string | null

  • completionListGet(cnc: Gda.Connection, sql: string, start: number, end: number): string[] | null
  • Creates an array of strings (terminated by a %NULL) corresponding to possible completions. If no completion is available, then the returned array contains just one NULL entry, and if it was not possible to try to compute a completions list, then %NULL is returned.

    Parameters

    • cnc: Gda.Connection

      a #GdaConnection object

    • sql: string

      a partial SQL statement which is the context of the completion proposal, may also start with a "." for Gda's tools which use internal commands

    • start: number

      starting position within sql of the "token" to complete (starts at 0)

    • end: number

      ending position within sql of the "token" to complete

    Returns string[] | null

  • Creates an INSERT, an UPDATE and a DELETE statement from a SELECT statement using the database metadata available in cnc's meta store. Each statements are computed only if the corresponding place to store the created statement is not %NULL.

    Parameters

    • cnc: Gda.Connection

      a #GdaConnection

    • selectStmt: Gda.Statement

      a SELECT #GdaStatement (compound statements not handled)

    • requirePk: boolean

      TRUE if the created statement have to use a primary key

    Returns [boolean, Gda.Statement | null, Gda.Statement | null, Gda.Statement | null]

  • Computes a SELECT statement which selects all the rows the update_stmt would update. Beware however that this #GdaSqlStatement does not select anything (ie it would be rendered as "SELECT FROM ... WHERE ...") and before being usable, one needs to add some fields to actually select.

    Parameters

    Returns Gda.SqlStatement | null

  • Computes a #GdaSqlExpr expression which can be used in the WHERE clause of an UPDATE or DELETE statement when a row from the result of the stsel statement has to be modified.

    Parameters

    Returns Gda.SqlExpr | null

  • Computes a #GdaSqlExpr expression which can be used in the WHERE clause of an UPDATE or DELETE statement when a row from the result of the stsel statement has to be modified.

    If require_pk is %TRUE then this function will return a non %NULL #GdaSqlExpr only if it can use a primary key of mtable. If require_pk is %FALSE, then it will try to use a primary key of mtable, and if none is available, it will use all the columns of mtable to compute a condition statement.

    Parameters

    Returns Gda.SqlExpr | null

  • Obtain a pointer to a #GdaDataHandler which can manage #GValue values of type for_type. The returned data handler will be adapted to use the current locale information (for example dates will be formatted taking into account the locale).

    The returned pointer is %NULL if there is no default data handler available for the for_type data type

    Parameters

    • forType: GType<unknown>

      a #GType type

    Returns Gda.DataHandler

  • dataModelErrorQuark(): Quark
  • ddlModifiableErrorQuark(): Quark
  • defaultEscapeString(string: string): string | null
  • Escapes string to make it understandable by a DBMS. The escape method is very common and replaces any occurrence of "'" with "''" and "" with "\"

    Parameters

    • string: string

      string to escape

    Returns string | null

  • defaultUnescapeString(string: string): string | null
  • Do the reverse of gda_default_escape_string(): transforms any "''" into "'", any "\" into "" and any "'" into "'".

    Parameters

    • string: string

      string to unescape

    Returns string | null

  • dsnSplit(string: string, outDsn: string, outUsername: string, outPassword: string): void
  • Extract the DSN, username and password from string. in string, the various parts are strings which are expected to be encoded using an RFC 1738 compliant encoding. If they are specified, the returned username and password strings are correctly decoded.

    out_username and out_password may be set to %NULL depending on string's format.

    Parameters

    • string: string

      a string in the "[<username>[:<password>]]<DSN>" form

    • outDsn: string

      a place to store the new string containing the <DSN> part

    • outUsername: string

      a place to store the new string containing the <username> part

    • outPassword: string

      a place to store the new string containing the <password> part

    Returns void

  • gTypeFromString(str: string): GType
  • Converts a named type to ts GType type (also see the gda_g_type_to_string() function).

    This function is a wrapper around the g_type_from_name() function, but also recognizes some type synonyms such as: "int" for G_TYPE_INT "uint" for G_TYPE_UINT "int64" for G_TYPE_INT64 "uint64" for G_TYPE_UINT64 "char" for G_TYPE_CHAR "uchar" for G_TYPE_UCHAR "short" for GDA_TYPE_SHORT "ushort" for GDA_TYPE_USHORT "string" for G_TYPE_STRING "date" for G_TYPE_DATE "time" for GDA_TYPE_TIME "timestamp" for G_TYPE_DATE_TIME "boolean" for G_TYPE_BOOLEAN "blob" for GDA_TYPE_BLOB "binary" for GDA_TYPE_BINARY "null" for GDA_TYPE_NULL

    Parameters

    • str: string

      the name of a #GType, as returned by gda_g_type_to_string().

    Returns GType

  • gTypeToString(type: GType<unknown>): string
  • Converts a GType to its string representation (use gda_g_type_from_string() for the operation in the other direction).

    This function wraps g_type_name() but for common types it provides an easier to understand and remember name. For Example the G_TYPE_STRING is converted to "string" whereas g_type_name() converts it to "gchararray".

    Parameters

    • type: GType<unknown>

      Type to convert from.

    Returns string

  • identifierEqual(id1: string, id2: string): boolean
  • Does the same as strcmp(id1, id2), but handles the case where id1 and/or id2 are enclosed in double quotes. can also be used in hash tables as a #GEqualFunc.

    Parameters

    • id1: string

      an identifier string

    • id2: string

      an identifier string

    Returns boolean

  • identifierHash(id: string): number
  • computes a hash string from id, to be used in hash tables as a #GHashFunc

    Parameters

    • id: string

      an identifier string

    Returns number

  • logDisable(): void
  • logEnable(): void
  • logIsEnabled(): boolean
  • This function is similar to gda_parse_iso8601_date() (with first being G_DATE_YEAR, second being G_DATE_MONTH, third being G_DATE_DAY and sep being '-') but allows one to specify the expected date format.

    Parameters

    • gdate: GLib.Date

      a pointer to a #GDate structure which will be filled

    • value: string

      a string to be parsed

    • first: DateDMY

      a #GDateDMY specifying which of year, month or day appears first (in the first bytes) in value

    • second: DateDMY

      a #GDateDMY specifying which of year, month or day appears second (in the first bytes) in value

    • third: DateDMY

      a #GDateDMY specifying which of year, month or day appears third (in the first bytes) in value

    • sep: number

      spcifies the expected separator character bewteen year, month and day (for example '-')

    Returns boolean

  • parseFormattedTime(value: string, sep: number): Gda.Time
  • This function is similar to g_date_time_new_from_iso8601() (with first being G_DATE_YEAR, second being G_DATE_MONTH, third being G_DATE_DAY and sep being '-') but allows one to specify the expected date format.

    Parameters

    • value: string

      a string to be parsed

    • first: DateDMY

      a #GDateDMY specifying which of year, month or day appears first (in the first bytes) in value

    • second: DateDMY

      a #GDateDMY specifying which of year, month or day appears second (in the first bytes) in value

    • third: DateDMY

      a #GDateDMY specifying which of year, month or day appears third (in the first bytes) in value

    • sep: number

      specifies the expected separator character between year, month and day (for example '-')

    Returns GLib.DateTime | null

  • parseIso8601Date(gdate: GLib.Date, value: string): boolean
  • Extracts date parts from value, and sets gdate's contents

    Accepted date format is "YYYY-MM-DD" (more or less than 4 digits for years and less than 2 digits for month and day are accepted). Years must be in the 1-65535 range, a limitation imposed by #GDate.

    Parameters

    • gdate: GLib.Date

      a pointer to a #GDate structure which will be filled

    • value: string

      a string

    Returns boolean

  • parseIso8601Time(value: string): Gda.Time
  • Extracts time parts from value, and sets timegda's contents

    Accepted date format is "HH:MM:SS[.ms][TZ]" where TZ is +hour or -hour. If no time zone is given UTC is used.

    Parameters

    • value: string

      a string

    Returns Gda.Time

  • providerMetaErrorQuark(): Quark
  • Modifies sqlst to take into account any parameter which might be %NULL: if sqlst contains the equivalent of "xxx = <parameter definition>" and if that parameter is in params and its value is of type GDA_TYPE_NUL, then that part is replaced with "xxx IS NULL". It also handles the "xxx IS NOT NULL" transformation.

    If out_modified is not %NULL, then it will be set to %TRUE if sqlst has been modified by this function, and to %FALSE otherwise.

    This function is used by provider's implementations to make sure one can use parameters with NULL values in statements without having to rewrite statements, as database usually don't consider that "xxx = NULL" is the same as "xxx IS NULL" when using parameters.

    Parameters

    • sqlst: Gda.SqlStatement

      a #GdaSqlStatement

    • params: Gda.Set

      a #GdaSet to be used as parameters when executing stmt

    Returns [Gda.SqlStatement | null, boolean | null]

  • Modifies stmt to take into account any parameter which might be %NULL: if stmt contains the equivalent of "xxx = <parameter definition>" and if that parameter is in params and its value is of type GDA_TYPE_NUL, then that part is replaced with "xxx IS NULL". It also handles the "xxx IS NOT NULL" transformation.

    For example the following SELECT: SELECT * FROM data WHERE id = ##id::int::null AND name = ##name::string in case the "id" parameter is set to NULL, is converted to: SELECT * FROM data WHERE id IS NULL AND name = ##name::string

    if out_stmt is not %NULL, then it will contain: the modified statement if some modifications were required and no error occured (the function returns %TRUE) %NULL if no modification to stmt were required and no erro occurred (the function returns %FALSE) %NULL if an error occured (the function returns %TRUE)

    This function is used by provider's implementations to make sure one can use parameters with NULL values in statements without having to rewrite statements, as database usually don't consider that "xxx = NULL" is the same as "xxx IS NULL" when using parameters.

    Parameters

    • stmt: Gda.Statement

      a #GdaStatement

    • params: Gda.Set

      a #GdaSet to be used as parameters when executing stmt

    Returns [boolean, Gda.Statement | null]

  • rfc1738Decode(string: string): boolean
  • Decodes string using the RFC 1738 recommendations: the <>"#%{}|^~[]';/?:=`& and space characters are replaced by "%%ab" where ab is the hexadecimal number corresponding to the character.

    string should respect the RFC 1738 encoding. If this is not the case (for example if there is a "%2z" because 2z is not an hexadecimal value), then the part with the problem is not decoded, and the function returns FALSE.

    string is decoded in place, no new string gets created.

    Parameters

    • string: string

      a string to decode

    Returns boolean

  • rfc1738Encode(string: string): string | null
  • Encodes string using the RFC 1738 recommendations: the <>"#%{}|^~[]';/?:=`& and space characters are replaced by "%%ab" where ab is the hexadecimal number corresponding to the character.

    Parameters

    • string: string

      a string to encode

    Returns string | null

  • Creates a new #GdaStatement, selecting the same data as stmt, but which always returns an empty (no row) data model. This is use dy database providers' implementations.

    Parameters

    Returns Gda.Statement

  • serverOperationCreateTableArgGetFkeyRefFieldGetType(): GType
  • sqlIdentifierForceQuotes(str: string): string
  • Add double quotes around the str identifier. This function is normally used only by database provider's implementation. Any double quote character is replaced by two double quote characters.

    For other uses, see gda_sql_identifier_quote().

    Parameters

    • str: string

      an SQL identifier

    Returns string

  • sqlIdentifierPrepareForCompare(str: string): string
  • Prepares str to be compared: if surrounded by double quotes or single quotes, then just remove the quotes otherwise convert to lower case

    The quoted string: must start and finish with the same single or double quotes character can contain the delimiter character (the single or double quotes) in the string if every instance of it is preceeded with a backslash character or with the delimiter character itself

    This function is normally used only by database provider's implementation.

    WARNING: str must NOT be a composed identifier (<part1>."<part2>" for example) WARNING: you may have to #include <sql-parser/gda-sql-parser.h>

    Parameters

    • str: string

      a quoted string

    Returns string

  • Use this function for any SQL identifier to make sure that: it is correctly formatted to be used with cnc (if cnc is %NULL, then some default SQL quoting rules will be applied, similar to PostgreSQL's way) if for_meta_store is %FALSE; it is correctly formatted to be used with the #GdaMetaStore's object associated to cnc is for_meta_store is %TRUE.

    The force_quotes allow some control of how to interpret id: if %FALSE, then id will be left unchanged most of the time (except for example if it's a reserved keyword), otherwise if force_quotes is %TRUE, then the returned string will most probably have quotes around it to request that the database keep the case sensitiveness (but again, this may vary depending on the database being accessed through cnc).

    For example, the following table gives the result of this function depending on the arguments when cnc is %NULL (and prov is also %NULL):

    id for_meta_store=%FALSE, force_quotes=%FALSE for_meta_store=%TRUE, force_quotes=%FALSE for_meta_store=%FALSE, force_quotes=%TRUE for_meta_store=%TRUE, force_quotes=%TRUE remark "double word" "double word" "double word" "double word" "double word" non allowed character in SQL identifier "CapitalTest" "CapitalTest" "CapitalTest" "CapitalTest" "CapitalTest" Mixed case SQL identifier, already quoted CapitalTest CapitalTest capitaltest "CapitalTest" "CapitalTest" Mixed case SQL identifier, non quoted "mytable" "mytable" mytable "mytable" mytable All lowser case, quoted mytable mytable mytable "mytable" mytable All lowser case MYTABLE MYTABLE mytable "MYTABLE" "MYTABLE" All upper case "MYTABLE" "MYTABLE" "MYTABLE" "MYTABLE" "MYTABLE" All upper case, quoted desc "desc" "desc" "desc" "desc" SQL reserved keyword 5ive "5ive" "5ive" "5ive" "5ive" SQL identifier starting with a digit

    Here are a few examples of when and how to use this function: When creating a table, the user has entered the table name, this function can be used to create a valid SQL identifier from the user provided table name: gchar user_sqlid=... gchar valid_sqlid = gda_sql_identifier_quote (user_sqlid, cnc, NULL, FALSE, FALSE); gchar sql = g_strdup_printf ("CREATE TABLE %s ...", valid_sqlid); g_free (valid_sqlid); Note that this is an illustration and creating a table should be sone using a #GdaServerOperation object. When updating the meta data associated to a table which has been created with the code above: GValue table_name_value = { 0 }; gchar column_names[] = { (gchar)"table_name" }; GValue column_values[] = { &table_name_value }; GdaMetaContext mcontext = { (gchar*)"_tables", 1, column_names, column_values }; g_value_init (&table_name_value, G_TYPE_STRING); g_value_take_string (&table_name_value, gda_sql_identifier_quote (user_sqlid, cnc, NULL, TRUE, FALSE); gda_connection_update_meta_store (cnc, &mcontext, NULL); g_value_reset (&table_name_value); When using a #GdaMetaStruct object to fetch information about a table (which has been created with the code above): GValue table_name_value = { 0 }; g_value_init (&table_name_value, G_TYPE_STRING); g_value_take_string (&table_name_value, gda_sql_identifier_quote (user_sqlid, cnc, NULL, TRUE, FALSE); GdaMetaDbObject *dbo; dbo = gda_meta_struct_complement (mstruct, GDA_META_DB_TABLE, NULL, NULL, &table_name_value, NULL); g_value_reset (&table_name_value);

    Note that id must not be a composed SQL identifier (such as "mytable.mycolumn" which should be treated as the "mytable" and "mycolumn" SQL identifiers). If unsure, use gda_sql_identifier_split().

    Also note that if cnc is %NULL, then it's possible to pass an non %NULL prov to have a result specific to prov.

    For more information, see the SQL identifiers and abstraction and

    SQL identifiers in meta data sections.

    Parameters

    • id: string

      an SQL identifier

    • cnc: Gda.Connection

      a #GdaConnection object, or %NULL

    • prov: Gda.ServerProvider

      a #GdaServerProvider object, or %NULL for_meta_store set to %TRUE if the returned string will be used in a #GdaMetaStore

    • metaStoreConvention: boolean
    • forceQuotes: boolean

      set to %TRUE to force the returned string to be quoted

    Returns string | null

  • sqlIdentifierSplit(id: string): string[] | null
  • Splits id into an array of it sub parts. id's format has to be "<part>[.<part>[...]]" where each part is either a text surrounded by double quotes which can contain upper and lower cases or an SQL identifier in lower case.

    For example the string will result in the array:

    Parameters

    • id: string

      an SQL identifier

    Returns string[] | null

  • Returns a constant string representing a operator name. You don't need to free the returned string.

    Parameters

    Returns string

  • Converts a string to a #GdaSqlStatementType value, see also gda_sql_statement_type_to_string()

    Parameters

    • type: string

      a string representing a #GdaSqlStatementType type

    Returns Gda.SqlStatementType

  • Converts a #GdaSqlStatementType to a string, see also gda_sql_statement_string_to_type()

    Parameters

    Returns string

  • sqlValueStringify(value: any): string
  • Simplified version of gda_value_stringify().

    Parameters

    • value: any

      a #GValue pointer

    Returns string

  • Performs the reverse of gda_binary_to_string() (note that for any "\xyz" succession of 4 characters where "xyz" represents a valid octal value, the resulting read value will be modulo 256).

    I str is %NULL, then an empty (i.e. where the data part is %NULL) #GdaBinary is created and returned.

    Parameters

    • str: string

      a string to convert, or %NULL

    Returns Gda.Binary

  • stringToBlob(str: string): Gda.Blob
  • Performs the reverse of gda_blob_to_string().

    Parameters

    • str: string

      a string to convert

    Returns Gda.Blob

  • textToAlphanum(text: string): string
  • The "encoding" consists in replacing non alphanumeric character with the string "__gdaXX" where XX is the hex. representation of the non alphanumeric char.

    Parameters

    • text: string

      the text to convert

    Returns string

  • Check the column types of a GdaDataModel.

    Parameters

    • model: Gda.DataModel

      a #GdaDataModel object

    • types: GType<unknown>[]

      array with nbcols length of type GType or null (if any data type is accepted)

    Returns boolean

  • utilityDataModelDumpDataToXml(model: Gda.DataModel, parent: NodePtr, cols: number[], rows: number[], useColIds: boolean): boolean
  • Dump the data in a #GdaDataModel into a xmlNodePtr (as used in libxml).

    Warning: this function uses a #GdaDataModelIter iterator, and if model does not offer a random access (check using gda_data_model_get_access_flags()), the iterator will be the same as normally used to access data in model previously to calling this method, and this iterator will be moved (point to another row).

    Parameters

    • model: Gda.DataModel

      a #GdaDataModel

    • parent: NodePtr

      the parent XML node

    • cols: number[]

      an array containing which columns of model will be exported, or %NULL for all columns

    • rows: number[]

      an array containing which rows of model will be exported, or %NULL for all rows

    • useColIds: boolean

      set to %TRUE to add column ID information

    Returns boolean

  • utilityDataModelFindColumnDescription(model: Gda.DataSelect, fieldName: string): string | null
  • Finds the description of a field into Metadata from a #GdaDataModel.

    Parameters

    • model: Gda.DataSelect

      a #GdaDataSelect data model

    • fieldName: string

      field name

    Returns string | null

  • Note: this method may set the "source" custom string property

    Parameters

    Returns boolean

  • valueCompare(value1: any, value2: any): number
  • Compares two values of the same type, with the exception that a value of any type can be compared to a GDA_TYPE_NULL value, specifically: if value1 and value2 are both GDA_TYPE_NULL values then the returned value is 0 if value1 is a GDA_TYPE_NULL value and value2 is of another type then the returned value is -1 if value1 is of another type and value2 is a GDA_TYPE_NULL value then the returned value is 1 in all other cases, value1 and value2 must be of the same type and their values are compared

    Parameters

    • value1: any

      a #GValue to compare (not %NULL)

    • value2: any

      the other #GValue to be compared to value1 (not %NULL)

    Returns number

  • valueCopy(value: any): any
  • Creates a new #GValue from an existing one.

    Parameters

    • value: any

      value to get a copy from.

    Returns any

  • valueDiffer(value1: any, value2: any): number
  • Tells if two values are equal or not, by comparing memory representations. Unlike gda_value_compare(), the returned value is boolean, and gives no idea about ordering.

    The two values must be of the same type, with the exception that a value of any type can be compared to a GDA_TYPE_NULL value, specifically: if value1 and value2 are both GDA_TYPE_NULL values then the returned value is 0 if value1 is a GDA_TYPE_NULL value and value2 is of another type then the returned value is 1 if value1 is of another type and value2 is a GDA_TYPE_NULL value then the returned value is 1 in all other cases, value1 and value2 must be of the same type and their values are compared

    Parameters

    • value1: any

      a #GValue to compare.

    • value2: any

      the other #GValue to be compared to value1.

    Returns number

  • valueFree(value: any): void
  • Deallocates all memory associated to a #GValue.

    Parameters

    • value: any

      the resource to free (or %NULL)

    Returns void

  • valueGetShort(value: any): number
  • valueGetUshort(value: any): number
  • valueIsNull(value: any): boolean
  • Tests if a given value is of type #GDA_TYPE_NULL.

    Parameters

    • value: any

      value to test.

    Returns boolean

  • valueIsNumber(value: any): boolean
  • Gets whether the value stored in the given #GValue is of numeric type or not.

    Parameters

    • value: any

      a #GValue.

    Returns boolean

  • valueNew(type: GType<unknown>): any
  • Creates a new #GValue of type type, left in the same state as when g_value_init() is called.

    Parameters

    • type: GType<unknown>

      the new value type.

    Returns any

  • valueNewBinary(val: number, size: number): any
  • Makes a new #GValue of type #GDA_TYPE_BINARY with value val.

    Parameters

    • val: number

      value to set for the new #GValue.

    • size: number

      the size of the memory pool pointer to by val.

    Returns any

  • valueNewBlob(val: number, size: number): any
  • Makes a new #GValue of type #GDA_TYPE_BLOB with the data contained by val.

    Parameters

    • val: number

      value to set for the new #GValue.

    • size: number

      the size of the memory pool pointer to by val.

    Returns any

  • valueNewBlobFromFile(filename: string): any
  • Makes a new #GValue of type #GDA_TYPE_BLOB interfacing with the contents of the file named filename

    Parameters

    • filename: string

      name of the file to manipulate

    Returns any

  • valueNewDateTimeFromTimet(val: number): any
  • Makes a new #GValue of type #G_TYPE_DATE_TIME with value val (of type time_t). The returned timestamp's value is relative to the current timezone (i.e. is localtime).

    For example, to get a time stamp representing the current date and time, use:

    ts = gda_value_new_date_time_from_timet (time (NULL));

    Parameters

    • val: number

      value to set for the new #GValue.

    Returns any

  • valueNewDefault(defaultVal: string): any
  • Creates a new default value.

    Parameters

    • defaultVal: string

      the default value as a string, or %NULL

    Returns any

  • valueNewFromString(asString: string, type: GType<unknown>): any
  • Makes a new #GValue of type type from its string representation.

    For more information about the string format, see the gda_value_set_from_string() function. This function is typically used when reading configuration files or other non-user input that should be locale independent.

    Parameters

    • asString: string

      stringified representation of the value.

    • type: GType<unknown>

      the new value type.

    Returns any

  • valueNewFromXml(node: NodePtr): any
  • Creates a GValue from an XML representation of it. That XML node corresponds to the following string representation: <value type="gdatype">value</value>

    For more information about the string format, see the gda_value_set_from_string() function. This function is typically used when reading configuration files or other non-user input that should be locale independent.

    Parameters

    • node: NodePtr

      an XML node representing the value.

    Returns any

  • valueNewNull(): any
  • Creates a new #GValue initiated to a #GdaNull structure with a #GDA_TYPE_NULL, to represent a NULL in the database.

    Returns any

  • valueNewTimeFromTimet(val: number): any
  • Makes a new #GValue of type #GDA_TYPE_TIME with value val (of type time_t). The returned times's value is relative to the current timezone (i.e. is localtime).

    For example, to get a time representing the current time, use:

    ts = gda_value_new_time_from_timet (time (NULL));

    Parameters

    • val: number

      value to set for the new #GValue.

    Returns any

  • valueResetWithType(value: any, type: GType<unknown>): void
  • Resets the #GValue and set a new type to #GType.

    Parameters

    • value: any

      the #GValue to be reseted

    • type: GType<unknown>

      the #GType to set to

    Returns void

  • valueSetBinary(value: any, binary: Gda.Binary): void
  • Stores val into value.

    Parameters

    • value: any

      a #GValue that will store val.

    • binary: Gda.Binary

      a #GdaBinary structure with the data and its size to be stored in value.

    Returns void

  • valueSetBlob(value: any, blob: Gda.Blob): void
  • Stores val into value.

    Parameters

    • value: any

      a #GValue that will store val.

    • blob: Gda.Blob

      a #GdaBlob structure with the data and its size to be stored in value.

    Returns void

  • valueSetFromString(value: any, asString: string, type: GType<unknown>): boolean
  • Stores the value data from its string representation as type.

    The accepted formats are: G_TYPE_BOOLEAN: a caseless comparison is made with "true" or "false" numerical types: C locale format (dot as a fraction separator) G_TYPE_DATE: see gda_parse_iso8601_date() GDA_TYPE_TIME: see gda_parse_iso8601_time() GDA_TYPE_TIMESTAMP: see g_date_time_new_from_iso8601()

    This function is typically used when reading configuration files or other non-user input that should be locale independent.

    Parameters

    • value: any

      a #GValue that will store val.

    • asString: string

      the stringified representation of the value.

    • type: GType<unknown>

      the type of the value

    Returns boolean

  • valueSetFromValue(value: any, from: any): boolean
  • Sets the value of a #GValue from another #GValue. This is different from #gda_value_copy, which creates a new #GValue. #gda_value_set_from_value, on the other hand, copies the contents of copy into value, which must already be allocated.

    If values are incompatible (see g_value_type_compatible) then value is set to a #GDA_TYPE_NULL, and %FALSE is returned.

    Parameters

    • value: any

      a #GValue.

    • from: any

      the value to copy from.

    Returns boolean

  • valueSetNull(value: any): void
  • Sets the type of value to #GDA_TYPE_NULL.

    Parameters

    • value: any

      a #GValue that will store a value of type #GDA_TYPE_NULL.

    Returns void

  • valueSetNumeric(value: any, val: Gda.Numeric): void
  • Stores val into value.

    Parameters

    • value: any

      a #GValue that will store val.

    • val: Gda.Numeric

      value to be stored in value.

    Returns void

  • valueSetShort(value: any, val: number): void
  • Stores val into value.

    Parameters

    • value: any

      a #GValue that will store val.

    • val: number

      value to be stored in value.

    Returns void

  • valueSetTime(value: any, val: Gda.Time): void
  • Stores val into value.

    Parameters

    • value: any

      a #GValue that will store val.

    • val: Gda.Time

      value to be stored in value.

    Returns void

  • valueSetUshort(value: any, val: number): void
  • Stores val into value.

    Parameters

    • value: any

      a #GValue that will store val.

    • val: number

      value to be stored in value.

    Returns void

  • valueStringify(value: any): string
  • Converts a GValue to its string representation which is a human readable value. Note that the returned string does not take into account the current locale of the user (on the contrary to the #GdaDataHandler objects). Using this function should be limited to debugging and values serialization purposes.

    Output is in the "C" locale for numbers, and dates are converted in a YYYY-MM-DD format.

    Parameters

    • value: any

      a #GValue.

    Returns string

  • valueTakeBinary(value: any, binary: Gda.Binary): void
  • Stores val into value, but on the contrary to gda_value_set_binary(), the binary argument is not copied, but used as-is and it should be considered owned by value.

    Parameters

    • value: any

      a #GValue that will store val.

    • binary: Gda.Binary

      a #GdaBinary structure with the data and its size to be stored in value.

    Returns void

  • valueTakeBlob(value: any, blob: Gda.Blob): void
  • Stores val into value, but on the contrary to gda_value_set_blob(), the blob argument is not copied, but used as-is and it should be considered owned by value.

    Parameters

    • value: any

      a #GValue that will store val.

    • blob: Gda.Blob

      a #GdaBlob structure with the data and its size to be stored in value.

    Returns void

  • valueToXmlString(value: any): string
  • This methods creates an XML string representation of a #GValue

    Parameters

    • value: any

      a #GValue to convert to string

    Returns string

  • workerErrorQuark(): Quark
  • This function creates a new #GdaWorker, or reuses the one at location. Specifically: if *location is %NULL, then a new #GdaWorker is created. In this case if allow_destroy is %FALSE, then the returned #GdaWorker's reference count is 2, thus preventing it form ever being destroyed (unless gda_worker_unref() is called somewhere else) if *location is not %NULL, the the #GdaWorker it points to is returned, its reference count increased by 1

    When the returned #GdaWorker's reference count reaches 0, then it is destroyed, and *location is set to %NULL.

    In any case, the returned value is the same as *location.

    Parameters

    • location: Gda.Worker

      a place to store and test for existence, not %NULL

    • allowDestroy: boolean

      defines if the created GdaWorker (see case 1 below) will allow its reference to drop to 0 and be destroyed

    Returns Gda.Worker

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method