The corresponding attribute is the description of the object it refers to (value has a G_TYPE_STRING type).
The corresponding attribute specifies if the object it refers to has its value to default (value has a G_TYPE_BOOLEAN type).
The corresponding attribute is the name of the object it refers to (value has a G_TYPE_STRING type).
The corresponding attribute is the number of significant digits of the object it refers to (value has a G_TYPE_INT type).
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).
This attribute, if %TRUE specifies that a tree node may or may not have any children nodes (value has a G_TYPE_BOOLEAN type).
Does the opposite of gda_text_to_alphanum(), in the same string
a string
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.
a #GdaConnection object
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
starting position within sql
of the "token" to complete (starts at 0)
ending position within sql
of the "token" to complete
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.
a #GdaConnection
a SELECT #GdaStatement (compound statements not handled)
TRUE if the created statement have to use a primary key
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.
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.
a #GdaSqlSelectStatement
a #GdaMetaTable
set to TRUE if a primary key ir required
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.
a #GdaConnection, or %NULL
a #GdaSqlSelectStatement
a #GdaMetaTable
set to %TRUE if a primary key is required
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
a #GType type
Escapes string
to make it understandable by a DBMS. The escape method is very common and replaces any
occurrence of "'" with "''" and "" with "\"
string to escape
Do the reverse of gda_default_escape_string(): transforms any "''" into "'", any "\" into "" and any "'" into "'".
string to unescape
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.
a string in the "[<username>[:<password>]]
<DSN>" form
a place to store the new string containing the <DSN> part
a place to store the new string containing the <username> part
a place to store the new string containing the <password> part
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:
the name of a #GType, as returned by gda_g_type_to_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".
Type to convert from.
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.
an identifier string
an identifier string
computes a hash string from id,
to be used in hash tables as a #GHashFunc
an identifier string
Disables GDA logs.
Enables GDA logs.
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.
a pointer to a #GDate structure which will be filled
a string to be parsed
a #GDateDMY specifying which of year, month or day appears first (in the first bytes) in value
a #GDateDMY specifying which of year, month or day appears second (in the first bytes) in value
a #GDateDMY specifying which of year, month or day appears third (in the first bytes) in value
spcifies the expected separator character bewteen year, month and day (for example '-')
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.
a string to be parsed
a #GDateDMY specifying which of year, month or day appears first (in the first bytes) in value
a #GDateDMY specifying which of year, month or day appears second (in the first bytes) in value
a #GDateDMY specifying which of year, month or day appears third (in the first bytes) in value
specifies the expected separator character between year, month and day (for example '-')
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.
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.
a #GdaSqlStatement
a #GdaSet to be used as parameters when executing stmt
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:
if out_stmt
is not %NULL, then it will contain:
stmt
were required and no erro occurred (the function returns %FALSE)
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.
a #GdaStatement
a #GdaSet to be used as parameters when executing stmt
Decodes string
using the RFC 1738 recommendations: the
;/?:
=`&
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.
a string to decode
Encodes string
using the RFC 1738 recommendations: the
;/?:
=`&
a string to encode
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().
an SQL identifier
Prepares str
to be compared:
The quoted string:
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>
a quoted string
Use this function for any SQL identifier to make sure that:
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;
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):
Here are a few examples of when and how to use this function:
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.an SQL identifier
a #GdaConnection object, or %NULL
a #GdaServerProvider object, or %NULL for_meta_store
set to %TRUE if the returned string will be used in a #GdaMetaStore
set to %TRUE to force the returned string to be quoted
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:
an SQL identifier
Returns #GdaSqlOperatorType that correspond with the string op
.
a #GdaSqlOperation structure
Returns a constant string representing a operator name. You don't need to free the returned string.
a #GdaSqlOperation structure
Creates a new string representing the join type.
a #GdaSqlSelectJoinType structure to be copied
Converts a string to a #GdaSqlStatementType value, see also gda_sql_statement_type_to_string()
a string representing a #GdaSqlStatementType type
Converts a #GdaSqlStatementType to a string, see also gda_sql_statement_string_to_type()
a #GdaSqlStatementType value
Simplified version of gda_value_stringify().
a #GValue pointer
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.
a string to convert, or %NULL
The "encoding" consists in replacing non alphanumeric character with the string "__gdaXX" where XX is the hex. representation of the non alphanumeric char.
the text to convert
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).
a #GdaDataModel
the parent XML node
an array containing which columns of model
will be exported, or %NULL for all columns
an array containing which rows of model
will be exported, or %NULL for all rows
set to %TRUE to add column ID information
Finds the description of a field into Metadata from a #GdaDataModel.
a #GdaDataSelect data model
field name
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:
value1
and value2
are both GDA_TYPE_NULL values then the returned value is 0value1
is a GDA_TYPE_NULL value and value2
is of another type then the returned value is -1value1
is of another type and value2
is a GDA_TYPE_NULL value then the returned value is 1value1
and value2
must be of the same type and their values are compared
a #GValue to compare (not %NULL)
the other #GValue to be compared to value1
(not %NULL)
Creates a new #GValue from an existing one.
value to get a copy from.
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:
value1
and value2
are both GDA_TYPE_NULL values then the returned value is 0value1
is a GDA_TYPE_NULL value and value2
is of another type then the returned value is 1value1
is of another type and value2
is a GDA_TYPE_NULL value then the returned value is 1value1
and value2
must be of the same type and their values are compared
a #GValue to compare.
the other #GValue to be compared to value1
.
Deallocates all memory associated to a #GValue.
the resource to free (or %NULL)
Tests if a given value
is of type #GDA_TYPE_NULL.
value to test.
Gets whether the value stored in the given #GValue is of numeric type or not.
a #GValue.
Creates a new #GValue of type type,
left in the same state as when g_value_init() is called.
the new value type.
Makes a new #GValue of type #GDA_TYPE_BINARY with value val
.
value to set for the new #GValue.
the size of the memory pool pointer to by val
.
Makes a new #GValue of type #GDA_TYPE_BLOB with the data contained by val
.
value to set for the new #GValue.
the size of the memory pool pointer to by val
.
Makes a new #GValue of type #GDA_TYPE_BLOB interfacing with the contents of the file
named filename
name of the file to manipulate
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));
value to set for the new #GValue.
Creates a new default value.
the default value as a string, or %NULL
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.
stringified representation of the value.
the new value type.
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.
an XML node representing the value.
Creates a new #GValue initiated to a #GdaNull structure with a #GDA_TYPE_NULL, to represent a NULL in the database.
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));
value to set for the new #GValue.
Resets the #GValue and set a new type to #GType.
the #GValue to be reseted
the #GType to set to
Stores the value data from its string representation as type
.
The accepted formats are:
This function is typically used when reading configuration files or other non-user input that should be locale independent.
a #GValue that will store val
.
the stringified representation of the value.
the type of the value
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.
a #GValue.
the value to copy from.
Stores val
into value
.
a #GValue that will store val
.
value to be stored in value
.
Sets the type of value
to #GDA_TYPE_NULL.
a #GValue that will store a value of type #GDA_TYPE_NULL.
Stores val
into value
.
a #GValue that will store val
.
value to be stored in value
.
Stores val
into value
.
a #GValue that will store val
.
value to be stored in value
.
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.
a #GValue.
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
.
a #GValue that will store val
.
a #GdaBinary structure with the data and its size to be stored in value
.
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
.
a #GValue that will store val
.
a #GdaBlob structure with the data and its size to be stored in value
.
This methods creates an XML string representation of a #GValue
a #GValue to convert to string
This function creates a new #GdaWorker, or reuses the one at location
. Specifically:
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)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
.
a place to store and test for existence, not %NULL
defines if the created GdaWorker
(see case 1 below) will allow its reference to drop to 0 and be destroyed
The corresponding attribute specifies if the object it refers to is auto incremented (value has a G_TYPE_BOOLEAN type).