- public string alphanum_to_text (string text)
- public string[]? completion_list_get (Connection cnc, string sql, int start, int end)
Creates an array of strings (terminated by a null
)
corresponding to possible completions.
- public bool compute_dml_statements (Connection cnc, Statement select_stmt, bool require_pk, owned Statement? insert_stmt, owned Statement? update_stmt, owned Statement? delete_stmt) throws Error
Creates an INSERT, an UPDATE and a DELETE statement from a SELECT
statement using the database metadata available in cnc
's meta store.
- public unowned DataHandler data_handler_get_default (Type for_type)
- public void dsn_split (string string, string out_dsn, string out_username, string out_password)
Extract the DSN, username and password from string
.
- public Type g_type_from_string (string str)
Converts a named type to ts GType type (also see the
g_type_to_string function).
- public unowned string g_type_to_string (Type type)
Converts a GType to its string representation (use
g_type_from_string for the operation in the other direction).
- public string get_application_exec_path (string app_name)
Find the path to the application identified by app_name
.
- public bool identifier_equal (string id1, string id2)
Does the same as strcmp(id1
, id2
), but
handles the case where id1 and/or id2 are enclosed in double quotes.
- public uint identifier_hash (string id)
computes a hash string from id
, to be used in hash
tables as a HashFunc
- public void init ()
Initializes the GDA library, must be called prior to any Libgda
usage.
- public void locale_changed ()
Call this function whenever the setlocale
function has been called to change the current locale; this function is first called by
init so you don't need to call it if you have set the locale before calling
init.
- public void log_disable ()
Disables GDA logs.
- public void log_enable ()
Enables GDA logs.
- public bool log_is_enabled ()
- public bool parse_formatted_date (Date gdate, string value, DateDMY first, DateDMY second, DateDMY third, char sep)
This function is similar to
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.
- public bool parse_formatted_time (Time timegda, string value, char sep)
- public bool parse_formatted_timestamp (Timestamp timestamp, string value, DateDMY first, DateDMY second, DateDMY third, char sep)
This function is similar to
parse_iso8601_timestamp (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.
- public bool parse_iso8601_date (Date gdate, string value)
Extracts date parts from value
, and sets gdate
's contents
- public bool parse_iso8601_time (Time timegda, string value)
Extracts time parts from value
, and sets timegda
's contents
- public bool parse_iso8601_timestamp (Timestamp timestamp, string value)
Extracts date and time parts from value
, and sets
timestamp
's contents
- public bool rewrite_statement_for_null_parameters (Statement stmt, Set @params, owned Statement? out_stmt) throws Error
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".
- public bool rfc1738_decode (string string)
- public string rfc1738_encode (string string)
- public Statement select_alter_select_for_empty (Statement stmt) throws Error
Creates a new Statement
, selecting the same data as stmt
, but which always returns an empty (no row) data model.
- public string sql_identifier_quote (string id, Connection? cnc, ServerProvider? prov, bool meta_store_convention, bool force_quotes)
- public string[]? sql_identifier_split (string id)
Splits id
into an array of it sub parts.
- public SqlOperatorType sql_operation_operator_from_string (string op)
- public unowned string sql_operation_operator_to_string (SqlOperatorType op)
- public Binary string_to_binary (string? str)
Performs the reverse of
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).
- public Blob string_to_blob (string str)
- public string text_to_alphanum (string text)
The "encoding" consists in replacing non alphanumeric character with
the string "__gdaXX" where XX is the hex.
- public bool utility_check_data_model_v (DataModel model, Type[] types)
Check the column types of a GdaDataModel.
- public bool utility_data_model_dump_data_to_xml (DataModel model, unowned Node* parent, int[]? cols, int[]? rows, bool use_col_ids)
Dump the data in a
DataModel into a xmlNodePtr (as used in libxml).
- public unowned string utility_data_model_find_column_description (DataSelect model, string field_name)
Finds the description of a field into Metadata from a
DataModel.
- public bool utility_holder_load_attributes (Holder holder, unowned Node* node, SList<DataModel> sources) throws Error
Note: this method may set the "source" custom string property
- public int value_compare (Value value1, Value value2)
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:
- public int value_differ (Value value1, Value value2)
Tells if two values are equal or not, by comparing memory
representations.
- public string value_stringify (Value value)
Converts a GValue to its string representation which is a human
readable value.