Gjsify LogoGjsify Logo

Hierarchy

Index

Constructors

Properties

authString: string
cncString: string
dsn: string
eventsHistorySize: number

Defines the number of #GdaConnectionEvent objects kept in memory which can be fetched using gda_connection_get_events().

executionSlowdown: number

Artificially slows down the execution of queries. This property can be used to debug some problems. If non zero, this value is the number of microseconds waited before actually executing each query.

executionTimer: boolean

Computes execution times for each statement executed.

gTypeInstance: TypeInstance
isWrapper: boolean

This property, if set to %TRUE, specifies that the connection is not a real connection, but rather a #GdaConnection object which "proxies" all the calls to another connection which executes in a sub thread.

Note: this property is used internally by Libgda and should not be directly used by any programs. Setting this property has no effect, reading it is supported, though.

metaStore: Gda.MetaStore
monitorWrappedInMainloop: boolean

Useful only when there is a mainloop and when the connection acts as a thread wrapper around another connection, it sets up a timeout to handle signals coming from the wrapped connection.

If the connection is not a thread wrapper, then this property has no effect.

object: GObject.Object
threadOwner: object
name: string

Methods

  • Adds an event to the given connection. This function is usually called by providers, to inform clients of events that happened during some operation.

    As soon as a provider (or a client, it does not matter) calls this function with an event object which is an error, the connection object emits the "error" signal, to which clients can connect to be informed of events.

    WARNING: the reference to the event object is stolen by this function!

    Parameters

    Returns void

  • Declares that prepared_stmt is a prepared statement object associated to gda_stmt within the connection (meaning the connection increments the reference counter of prepared_stmt).

    If gda_stmt changes or is destroyed, the the association will be lost and the connection will lose the reference it has on prepared_stmt.

    Parameters

    • gdaStmt: Gda.Statement

      a #GdaStatement object

    • preparedStmt: Gda.PStmt

      a prepared statement object (as a #GdaPStmt object, or more likely a descendant)

    Returns void

  • addSavepoint(name: string): boolean
  • Adds a SAVEPOINT named name.

    Parameters

    • name: string

      name of the savepoint to add

    Returns boolean

  • asyncCancel(taskId: number): boolean
  • Requests that a task be cancelled. This operation may of may not have any effect depending on the task's status, even if it returns %TRUE. If it returns %FALSE, then the task has not been cancelled.

    Parameters

    • taskId: number

      a task ID returned by gda_connection_async_statement_execute()

    Returns boolean

  • Use this method to obtain the result of the execution of a statement which has been executed asynchronously by calling gda_connection_async_statement_execute(). This function is non locking and will return %NULL (and no error will be set) if the statement has not been executed yet.

    If the statement has been executed, this method returns the same value as gda_connection_statement_execute() would have if the statement had been executed synchronously.

    Parameters

    • taskId: number

      a task ID returned by gda_connection_async_statement_execute()

    Returns [GObject.Object, Gda.Set]

  • This method is similar to gda_connection_statement_execute() but is asynchronous as it method returns immediately with a task ID. It's up to the caller to use gda_connection_async_fetch_result() regularly to check if the statement's execution is finished.

    It is possible to call the method several times to request several statements to be executed asynchronously, the statements will be executed in the order in which they were requested.

    The parameters, if present, are copied and can be discarded or modified before the statement is actually executed. The stmt object is not copied but simply referenced (for performance reasons), and if it is modified before it is actually executed, then its execution will not occur. It is however safe to call g_object_unref() on it if it's not needed anymore.

    The execution failure of any statement has no impact on the execution of other statements except for example if the connection has a transaction started and the failure invalidates the transaction (as decided by the database server).

    Note that for asynchronous calls to succeed, it is gererally necessary to specify the %GDA_CONNECTION_OPTIONS_THREAD_ISOLATED flag when opening the connection to be sure it is opened in a separate thread in which asynchronous calls are made (failing to use this flag make the asynchronous call dependant on the database provider implementation and at the moment none support this feature).

    Parameters

    • stmt: Gda.Statement

      a #GdaStatement object

    • params: Gda.Set

      a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL

    • modelUsage: Gda.StatementModelUsage

      in the case where stmt is a SELECT statement, specifies how the returned data model will be used

    • colTypes: GType<unknown>[]

      an array of GType to request each returned #GdaDataModel's column's GType, terminated with the G_TYPE_NONE

    • needLastInsertRow: boolean

      TRUE if the values of the last interted row must be computed

    Returns number

  • Executes all the statements contained in batch (in the order in which they were added to batch), and returns a list of #GObject objects, at most one #GObject for each statement; see gda_connection_statement_execute() for details about the returned objects.

    If one of the statement fails, then none of the subsequent statement will be executed, and the method returns the list of #GObject created by the correct execution of the previous statements. If a transaction is required, then it should be started before calling this method.

    Parameters

    • batch: Gda.Batch

      a #GdaBatch object which contains all the statements to execute

    • params: Gda.Set

      a #GdaSet object (which can be obtained using gda_batch_get_parameters()), or %NULL

    • modelUsage: Gda.StatementModelUsage

      specifies how the returned data model(s) will be used, as a #GdaStatementModelUsage enum

    Returns GObject.Object[]

  • Starts a transaction on the data source, identified by the name parameter.

    Before starting a transaction, you can check whether the underlying provider does support transactions or not by using the gda_connection_supports_feature() function.

    Parameters

    • name: string

      the name of the transation to start, or %NULL

    • level: Gda.TransactionIsolation

      the requested transaction level (%GDA_TRANSACTION_ISOLATION_UNKNOWN if not specified)

    Returns boolean

  • Creates a binding between source_property on source and target_property on target.

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

  • Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transformTo: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transformFrom: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • clearEventsList(): void
  • This function lets you clear the list of #GdaConnectionEvent's of the given connection.

    Returns void

  • close(): void
  • Closes the connection to the underlying data source, but first emits the "conn-to-close" signal.

    Returns void

  • closeNoWarning(): void
  • Closes the connection to the underlying data source, without emiting any warning signal.

    Returns void

  • commitTransaction(name: string): boolean
  • Commits the given transaction to the backend database. You need to call gda_connection_begin_transaction() first.

    Parameters

    • name: string

      the name of the transation to commit, or %NULL

    Returns boolean

  • connect(sigName: "conn-closed", callback: Connection_ConnClosedSignalCallback): number
  • connect(sigName: "conn-opened", callback: Connection_ConnOpenedSignalCallback): number
  • connect(sigName: "conn-to-close", callback: Connection_ConnToCloseSignalCallback): number
  • connect(sigName: "dsn-changed", callback: Gda.Connection_DsnChangedSignalCallback): number
  • connect(sigName: "error", callback: Gda.Connection_ErrorSignalCallback): number
  • connect(sigName: "transaction-status-changed", callback: Gda.Connection_TransactionStatusChangedSignalCallback): number
  • connect(sigName: "notify::auth-string", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::cnc-string", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::dsn", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::events-history-size", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::execution-slowdown", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::execution-timer", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::is-wrapper", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::meta-store", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::monitor-wrapped-in-mainloop", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::provider", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::thread-owner", callback: ((...args: any[]) => void)): number
  • connect(sigName: string, callback: ((...args: any[]) => void)): number
  • Parameters

    Returns number

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Parameters

    • sigName: "notify::auth-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::cnc-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::dsn"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::events-history-size"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::execution-slowdown"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::execution-timer"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::is-wrapper"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::meta-store"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::monitor-wrapped-in-mainloop"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::provider"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::thread-owner"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Creates a new #GdaServerOperation object which can be modified in order to perform the type type of action. It is a wrapper around the gda_server_provider_create_operation() method.

    Parameters

    Returns Gda.ServerOperation

  • Creates a new parser object able to parse the SQL dialect understood by cnc. If the #GdaServerProvider object internally used by cnc does not have its own parser, then %NULL is returned, and a general SQL parser can be obtained using gda_sql_parser_new().

    Returns Gda.SqlParser

  • Removes any prepared statement associated to gda_stmt in cnc: this undoes what gda_connection_add_prepared_statement() does.

    Parameters

    Returns void

  • deleteRowFromTable(table: string, conditionColumnName: string, conditionValue: any): boolean
  • This is a convenience function, which creates a DELETE statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.

    The equivalent SQL command is: DELETE FROM <table> WHERE <condition_column_name> = <condition_value>.

    Parameters

    • table: string

      the table's name with the row's values to be updated

    • conditionColumnName: string

      the name of the column to used in the WHERE condition clause

    • conditionValue: any

      the condition_column_type's GType

    Returns boolean

  • deleteSavepoint(name: string): boolean
  • Delete the SAVEPOINT named name when not used anymore.

    Parameters

    • name: string

      name of the savepoint to delete

    Returns boolean

  • emit(sigName: "conn-closed", ...args: any[]): void
  • emit(sigName: "conn-opened", ...args: any[]): void
  • emit(sigName: "conn-to-close", ...args: any[]): void
  • emit(sigName: "dsn-changed", ...args: any[]): void
  • emit(sigName: "error", ...args: any[]): void
  • emit(sigName: "transaction-status-changed", ...args: any[]): void
  • emit(sigName: "notify::auth-string", ...args: any[]): void
  • emit(sigName: "notify::cnc-string", ...args: any[]): void
  • emit(sigName: "notify::dsn", ...args: any[]): void
  • emit(sigName: "notify::events-history-size", ...args: any[]): void
  • emit(sigName: "notify::execution-slowdown", ...args: any[]): void
  • emit(sigName: "notify::execution-timer", ...args: any[]): void
  • emit(sigName: "notify::is-wrapper", ...args: any[]): void
  • emit(sigName: "notify::meta-store", ...args: any[]): void
  • emit(sigName: "notify::monitor-wrapped-in-mainloop", ...args: any[]): void
  • emit(sigName: "notify::provider", ...args: any[]): void
  • emit(sigName: "notify::thread-owner", ...args: any[]): void
  • emit(sigName: string, ...args: any[]): void
  • Parameters

    • sigName: "conn-closed"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "conn-opened"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "conn-to-close"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "dsn-changed"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "error"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "transaction-status-changed"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::auth-string"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::cnc-string"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::dsn"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::events-history-size"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::execution-slowdown"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::execution-timer"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::is-wrapper"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::meta-store"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::monitor-wrapped-in-mainloop"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::provider"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: "notify::thread-owner"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • sigName: string
    • Rest ...args: any[]

    Returns void

  • executeNonSelectCommand(sql: string): number
  • This is a convenience function to execute a SQL command over the opened connection. For the returned value, see gda_connection_statement_execute_non_select()'s documentation.

    Parameters

    • sql: string

      a query statement that must not begin with "SELECT"

    Returns number

  • Execute a SQL SELECT command over an opened connection.

    Parameters

    • sql: string

      a query statement that must begin with "SELECT"

    Returns Gda.DataModel

  • forceFloating(): void
  • This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    Returns void

  • freezeNotify(): void
  • Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

  • getAuthentication(): string
  • Gets the user name used to open this connection.

    Returns string

  • getCncString(): string
  • Gets the connection string used to open this connection.

    The connection string is the string sent over to the underlying database provider, which describes the parameters to be used to open a connection on the underlying data source.

    Returns string

  • getData(key?: string): object
  • Gets a named field from the objects table of associations (see g_object_set_data()).

    Parameters

    • Optional key: string

      name of the key for that association

    Returns object

  • getDsn(): string
  • Retrieves a list of the last errors occurred during the connection. The returned list is chronologically ordered such as that the most recent event is the #GdaConnectionEvent of the first node.

    Warning: the cnc object may change the list if connection events occur

    Returns Gda.ConnectionEvent[]

  • Retrieves a pointer to an object representing a prepared statement for gda_stmt within cnc. The association must have been done using gda_connection_add_prepared_statement().

    Parameters

    Returns Gda.PStmt

  • getProperty(propertyName?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional propertyName: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • getProviderName(): string
  • Gets the name (identifier) of the database provider used by cnc

    Returns string

  • getQdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • Get the status of cnc regarding transactions. The returned object should not be modified or destroyed; however it may be modified or destroyed by the connection itself.

    If %NULL is returned, then no transaction has been associated with cnc

    Returns Gda.TransactionStatus

  • getv(names: string[], values: any[]): void
  • Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • insertRowIntoTableV(table: string, colNames: string[], values: any[]): boolean
  • col_names and values must have length (>= 1).

    This is a convenience function, which creates an INSERT statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.

    The equivalent SQL command is: INSERT INTO <table> (<column_name> [,...]) VALUES (<column_name> = <new_value> [,...]).

    Parameters

    • table: string

      table's name to insert into

    • colNames: string[]

      a list of column names (as const gchar *)

    • values: any[]

      a list of values (as #GValue)

    Returns boolean

  • isFloating(): boolean
  • isOpened(): boolean
  • Checks whether a connection is open or not.

    Returns boolean

  • lock(): void
  • Locks lockable. If it is already locked by another thread, the current thread will block until it is unlocked by the other thread.

    This function can be used even if g_thread_init() has not yet been called, and, in that case, will do nothing.

    Note: unlike g_mutex_lock(), this method recursive, which means a thread can lock lockable several times (and has to unlock it as many times to actually unlock it).

    Returns void

  • notify(propertyName: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • propertyName: string

      the name of a property installed on the class of object.

    Returns void

  • Emits a "notify" signal for the property specified by pspec on object.

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • off(sigName: "conn-closed", callback: Connection_ConnClosedSignalCallback): EventEmitter
  • off(sigName: "conn-opened", callback: Connection_ConnOpenedSignalCallback): EventEmitter
  • off(sigName: "conn-to-close", callback: Connection_ConnToCloseSignalCallback): EventEmitter
  • off(sigName: "dsn-changed", callback: Gda.Connection_DsnChangedSignalCallback): EventEmitter
  • off(sigName: "error", callback: Gda.Connection_ErrorSignalCallback): EventEmitter
  • off(sigName: "transaction-status-changed", callback: Gda.Connection_TransactionStatusChangedSignalCallback): EventEmitter
  • off(sigName: "notify::auth-string", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::cnc-string", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::dsn", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::events-history-size", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::execution-slowdown", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::execution-timer", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::is-wrapper", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::meta-store", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::monitor-wrapped-in-mainloop", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::provider", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::thread-owner", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: string, callback: ((...args: any[]) => void)): EventEmitter
  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    • sigName: "notify::auth-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::cnc-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::dsn"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::events-history-size"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::execution-slowdown"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::execution-timer"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::is-wrapper"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::meta-store"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::monitor-wrapped-in-mainloop"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::provider"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::thread-owner"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • on(sigName: "conn-closed", callback: Connection_ConnClosedSignalCallback, after?: boolean): EventEmitter
  • on(sigName: "conn-opened", callback: Connection_ConnOpenedSignalCallback, after?: boolean): EventEmitter
  • on(sigName: "conn-to-close", callback: Connection_ConnToCloseSignalCallback, after?: boolean): EventEmitter
  • on(sigName: "dsn-changed", callback: Gda.Connection_DsnChangedSignalCallback, after?: boolean): EventEmitter
  • on(sigName: "error", callback: Gda.Connection_ErrorSignalCallback, after?: boolean): EventEmitter
  • on(sigName: "transaction-status-changed", callback: Gda.Connection_TransactionStatusChangedSignalCallback, after?: boolean): EventEmitter
  • on(sigName: "notify::auth-string", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::cnc-string", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::dsn", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::events-history-size", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::execution-slowdown", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::execution-timer", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::is-wrapper", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::meta-store", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::monitor-wrapped-in-mainloop", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::provider", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::thread-owner", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    • sigName: "notify::auth-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::cnc-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::dsn"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::events-history-size"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::execution-slowdown"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::execution-timer"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::is-wrapper"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::meta-store"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::monitor-wrapped-in-mainloop"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::provider"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::thread-owner"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • once(sigName: "conn-closed", callback: Connection_ConnClosedSignalCallback, after?: boolean): EventEmitter
  • once(sigName: "conn-opened", callback: Connection_ConnOpenedSignalCallback, after?: boolean): EventEmitter
  • once(sigName: "conn-to-close", callback: Connection_ConnToCloseSignalCallback, after?: boolean): EventEmitter
  • once(sigName: "dsn-changed", callback: Gda.Connection_DsnChangedSignalCallback, after?: boolean): EventEmitter
  • once(sigName: "error", callback: Gda.Connection_ErrorSignalCallback, after?: boolean): EventEmitter
  • once(sigName: "transaction-status-changed", callback: Gda.Connection_TransactionStatusChangedSignalCallback, after?: boolean): EventEmitter
  • once(sigName: "notify::auth-string", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::cnc-string", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::dsn", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::events-history-size", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::execution-slowdown", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::execution-timer", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::is-wrapper", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::meta-store", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::monitor-wrapped-in-mainloop", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::provider", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::thread-owner", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    Returns EventEmitter

  • Parameters

    • sigName: "notify::auth-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::cnc-string"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::dsn"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::events-history-size"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::execution-slowdown"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::execution-timer"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::is-wrapper"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::meta-store"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::monitor-wrapped-in-mainloop"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::provider"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::thread-owner"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • open(): boolean
  • This function helps to parse a SQL string which uses parameters and store them at params.

    Parameters

    • sql: string

      an SQL command to parse, not %NULL

    Returns [Gda.Statement, Gda.Set]

  • Performs the operation described by op (which should have been created using gda_connection_create_operation()). It is a wrapper around the gda_server_provider_perform_operation() method.

    Parameters

    Returns boolean

  • quoteSqlIdentifier(id: string): string
  • Use this method to get a correctly quoted (if necessary) SQL identifier which can be used in SQL statements, from id. If id is already correctly quoted for cnc, then a copy of id may be returned.

    This method may add double quotes (or other characters) around id: if id is a reserved SQL keyword (such as SELECT, INSERT, ...) if id contains non allowed characters such as spaces, or if it starts with a digit in any other event as necessary for cnc, depending on the the options passed when opening the cnc connection, and specifically the GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE option.

    One can safely pass an already quoted id to this method, either with quoting characters allowed by cnc or using the double quote (") character.

    Parameters

    • id: string

      an SQL identifier

    Returns string

  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

  • Increase the reference count of object, and possibly remove the [floating][floating-ref] reference, if object has a floating reference.

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

  • Executes the statement upon which rstmt is built. Note that as several statements can actually be executed by this method, it is recommended to be within a transaction.

    If error is not %NULL and stop_on_error is %FALSE, then it may contain the last error which occurred.

    Parameters

    • rstmt: Gda.RepetitiveStatement

      a #GdaRepetitiveStatement object

    • modelUsage: Gda.StatementModelUsage

      specifies how the returned data model will be used as a #GdaStatementModelUsage enum

    • colTypes: GType<unknown>[]

      an array of GType to request each returned GdaDataModel's column's GType, see gda_connection_statement_execute_select_full() for more information

    • stopOnError: boolean

      set to TRUE if the method has to stop on the first error.

    Returns GObject.Object[]

  • rollbackSavepoint(name: string): boolean
  • Rollback all the modifications made after the SAVEPOINT named name.

    Parameters

    • name: string

      name of the savepoint to rollback to

    Returns boolean

  • rollbackTransaction(name: string): boolean
  • Rollbacks the given transaction. This means that all changes made to the underlying data source since the last call to #gda_connection_begin_transaction() or #gda_connection_commit_transaction() will be discarded.

    Parameters

    • name: string

      the name of the transation to commit, or %NULL

    Returns boolean

  • runDispose(): void
  • Releases all references to other objects. This can be used to break reference cycles.

    This function should only be called from object system implementations.

    Returns void

  • setData(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • setProperty(propertyName: string, value?: any): void
  • Sets a property on an object.

    Parameters

    • propertyName: string

      the name of the property to set

    • Optional value: any

      the value

    Returns void

  • Executes stmt.

    As stmt can, by design (and if not abused), contain only one SQL statement, the return object will either be: a #GdaDataSelect object (which is also a #GdaDataModel) if stmt is a SELECT statement (usually a GDA_SQL_STATEMENT_SELECT, see #GdaSqlStatementType) containing the results of the SELECT. The resulting data model is by default read only, but modifications can be enabled, see the #GdaDataSelect's documentation for more information. a #GdaSet for any other SQL statement which correctly executed. In this case (if the provider supports it), then the #GdaSet may contain value holders named: a (gint) #GdaHolder named "IMPACTED_ROWS" a (GObject) #GdaHolder named "EVENT" which contains a #GdaConnectionEvent

    If last_insert_row is not %NULL and stmt is an INSERT statement, then it will contain (if the provider used by cnc supports it) a new #GdaSet object composed of value holders named "+<column number>" starting at column 0 which contain the actual inserted values. For example if a table is composed of an 'id' column which is auto incremented and a 'name' column then the execution of a "INSERT INTO mytable (name) VALUES ('joe')" query will return a #GdaSet with two holders: one with the '+0' ID which may for example contain 1 (note that its "name" property should be "id") one with the '+1' ID which will contain 'joe' (note that its "name" property should be "name")

    This method may fail with a %GDA_SERVER_PROVIDER_ERROR domain error (see the #GdaServerProviderError error codes).

    Note1: If stmt is a SELECT statement which has some parameters and if params is %NULL, then the statement can't be executed and this method will return %NULL.

    Note2: If stmt is a SELECT statement which has some parameters and if params is not %NULL but contains some invalid parameters, then the statement can't be executed and this method will return %NULL, unless the model_usage has the GDA_STATEMENT_MODEL_ALLOW_NOPARAM flag.

    Note3: If stmt is a SELECT statement which has some parameters and if params is not %NULL but contains some invalid parameters and if model_usage has the GDA_STATEMENT_MODEL_ALLOW_NOPARAM flag, then the returned data model will contain no row but will have all the correct columns (even though some of the columns might report as GDA_TYPE_NULL). In this case, if (after this method call) any of params' parameters change then the resulting data model will re-run itself, see the GdaDataSelect's

    auto-reset property for more information.

    Note4: if model_usage does not contain the GDA_STATEMENT_MODEL_RANDOM_ACCESS or GDA_STATEMENT_MODEL_CURSOR_FORWARD flags, then the default will be to return a random access data model

    Note5: If stmt is a SELECT statement which returns blob values (of type %GDA_TYPE_BLOB), then an implicit transaction will have been started by the database provider, and it's up to the caller to close the transaction (which will then be locked) once all the blob ressources have been liberated (when the returned data model is destroyed). See the section about

    Binary large objects (BLOBs) for more information.

    Also see the provider's limitations, and the

    Advanced GdaDataSelect usage sections.

    Parameters

    • stmt: Gda.Statement

      a #GdaStatement object

    • params: Gda.Set

      a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL

    • modelUsage: Gda.StatementModelUsage

      in the case where stmt is a SELECT statement, specifies how the returned data model will be used

    Returns [GObject.Object, Gda.Set]

  • Executes a non-selection statement on the given connection.

    This function returns the number of rows affected by the execution of stmt, or -1 if an error occurred, or -2 if the connection's provider does not return the number of rows affected.

    This function is just a convenience function around the gda_connection_statement_execute() function. See the documentation of the gda_connection_statement_execute() for information about the params list of parameters.

    See gda_connection_statement_execute() form more information about last_insert_row.

    Parameters

    • stmt: Gda.Statement

      a #GdaStatement object.

    • params: Gda.Set

      a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL

    Returns [number, Gda.Set]

  • Executes a selection command on the given connection.

    This function returns a #GdaDataModel resulting from the SELECT statement, or %NULL if an error occurred.

    This function is just a convenience function around the gda_connection_statement_execute() function.

    See the documentation of the gda_connection_statement_execute() for information about the params list of parameters.

    Parameters

    • stmt: Gda.Statement

      a #GdaStatement object.

    • params: Gda.Set

      a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL

    Returns Gda.DataModel

  • Executes a selection command on the given connection.

    This function returns a #GdaDataModel resulting from the SELECT statement, or %NULL if an error occurred.

    This function is just a convenience function around the gda_connection_statement_execute() function.

    See the documentation of the gda_connection_statement_execute() for information about the params list of parameters.

    Parameters

    • stmt: Gda.Statement

      a #GdaStatement object.

    • params: Gda.Set

      a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL

    • modelUsage: Gda.StatementModelUsage

      specifies how the returned data model will be used as a #GdaStatementModelUsage enum

    • colTypes: GType<unknown>[]

      an array of GType to request each returned #GdaDataModel's column's GType, terminated with the G_TYPE_NONE value. Any value left to 0 will make the database provider determine the real GType. col_types can also be %NULL if no column type is specified.

    Returns Gda.DataModel

  • Ask the database accessed through the cnc connection to prepare the usage of stmt. This is only useful if stmt will be used more than once (however some database providers may always prepare statements before executing them).

    This function is also useful to make sure stmt is fully understood by the database before actually executing it.

    Note however that it is also possible that gda_connection_statement_prepare() fails when gda_connection_statement_execute() does not fail (this will usually be the case with statements such as because database usually don't allow variables to be used in place of a table name).

    Parameters

    Returns boolean

  • Renders stmt as an SQL statement, adapted to the SQL dialect used by cnc

    Parameters

    • stmt: Gda.Statement

      a #GdaStatement object

    • params: Gda.Set

      a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL

    • flags: Gda.StatementSqlFlag

      SQL rendering flags, as #GdaStatementSqlFlag OR'ed values

    Returns [string, Gda.Holder[]]

  • stealData(key?: string): object
  • Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    Parameters

    • Optional key: string

      name of the key

    Returns object

  • stealQdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • thawNotify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • trylock(): boolean
  • Tries to lock lockable. If it is already locked by another thread, then it immediately returns FALSE, otherwise it locks lockable.

    This function can be used even if g_thread_init() has not yet been called, and, in that case, will do nothing.

    Note: unlike g_mutex_lock(), this method recursive, which means a thread can lock lockable several times (and has to unlock it as many times to actually unlock it).

    Returns boolean

  • unlock(): void
  • Unlocks lockable. This method should not be called if the current does not already holds a lock on lockable (having used gda_lockable_lock() or gda_lockable_trylock()).

    This function can be used even if g_thread_init() has not yet been called, and, in that case, will do nothing.

    Returns void

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

  • Updates cnc's associated #GdaMetaStore. If context is not %NULL, then only the parts described by context will be updated, and if it is %NULL, then the complete meta store will be updated. Detailed explanations follow:

    In order to keep the meta store's contents in a consistent state, the update process involves updating the contents of all the tables related to one where the contents change. For example the "_columns" table (which lists all the columns of a table) depends on the "_tables" table (which lists all the tables in a schema), so if a row is added, removed or modified in the "_tables", then the "_columns" table's contents needs to be updated as well regarding that row.

    If context is %NULL, then the update process will simply overwrite any data that was present in all the meta store's tables with new (up to date) data even if nothing has changed, without having to build the tables' dependency tree. This is the recommended way of proceeding when dealing with a meta store which might be outdated.

    On the other hand, if context is not %NULL, then a tree of the dependencies has to be built (depending on context) and only some parts of the meta store are updated following that dependencies tree. Specifying a context may be useful for example in the following situations: One knows that a database object has changed (for example a table created), and may use the context to request that only the information about that table be updated One is only interested in the list of views, and may request that only the information about views may be updated

    When context is not %NULL, and contains specified SQL identifiers (for example the "table_name" of the "_tables" table), then each SQL identifier has to match the convention the #GdaMetaStore has adopted regarding case sensitivity, using gda_connection_quote_sql_identifier() or gda_meta_store_sql_identifier_quote().

    see the meta data section about SQL identifiers for more information, and the documentation about the gda_sql_identifier_quote() function which will be most useful.

    Note however that usually more information will be updated than strictly requested by the context argument.

    For more information, see the Database structure section, and the Update the meta data about a table howto.

    Parameters

    • context: Gda.MetaContext

      description of which part of cnc's associated #GdaMetaStore should be updated, or %NULL

    Returns boolean

  • updateRowInTableV(table: string, conditionColumnName: string, conditionValue: any, colNames: string[], values: any[]): boolean
  • col_names and values must have length (>= 1).

    This is a convenience function, which creates an UPDATE statement and executes it using the values provided. It internally relies on variables which makes it immune to SQL injection problems.

    The equivalent SQL command is: UPDATE <table> SET <column_name> = <new_value> [,...] WHERE <condition_column_name> = <condition_value>.

    Parameters

    • table: string

      the table's name with the row's values to be updated

    • conditionColumnName: string

      the name of the column to used in the WHERE condition clause

    • conditionValue: any

      the condition_column_type's GType

    • colNames: string[]

      a list of column names (as const gchar *)

    • values: any[]

      a list of values (as #GValue)

    Returns boolean

  • valueToSqlString(from: any): string
  • Produces a fully quoted and escaped string from a GValue

    Parameters

    • from: any

      #GValue to convert from

    Returns string

  • watchClosure(closure: TClosure<any, any>): void
  • This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

  • compatControl(what: number, data: object): number
  • errorQuark(): number
  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • propertyName: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • This function is similar to gda_connection_open_from_dsn(), except it does not actually open the connection, you have to open it using gda_connection_open().

    Parameters

    • dsn: string

      data source name.

    • authString: string

      authentication string, or %NULL

    • options: Gda.ConnectionOptions

      options for the connection (see #GdaConnectionOptions).

    Returns Gda.Connection

  • This function is similar to gda_connection_open_from_string(), except it does not actually open the connection, you have to open it using gda_connection_open().

    Parameters

    • providerName: string

      provider ID to connect to, or %NULL

    • cncString: string

      connection string.

    • authString: string

      authentication string, or %NULL

    • options: Gda.ConnectionOptions

      options for the connection (see #GdaConnectionOptions).

    Returns Gda.Connection

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • objectType: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

  • This function is the way of opening database connections with libgda, using a pre-defined data source (DSN), see gda_config_define_dsn() for more information about how to define a DSN. If you don't want to define a DSN, it is possible to use gda_connection_open_from_string() instead of this method.

    The dsn string must have the following format: "[<username>[:<password>]]<DSN>" (if <username> and/or <password> are provided, and auth_string is %NULL, then these username and passwords will be used). Note that if provided, <username> and <password> must be encoded as per RFC 1738, see gda_rfc1738_encode() for more information.

    The auth_string can contain the authentication information for the server to accept the connection. It is a string containing semi-colon seperated named value, usually like "USERNAME=...;PASSWORD=..." where the ... are replaced by actual values. Note that each name and value must be encoded as per RFC 1738, see gda_rfc1738_encode() for more information.

    The actual named parameters required depend on the provider being used, and that list is available as the auth_params member of the #GdaProviderInfo structure for each installed provider (use gda_config_get_provider_info() to get it). Also one can use the "gda-sql-5.0 -L" command to list the possible named parameters.

    This method may fail with a GDA_CONNECTION_ERROR domain error (see the #GdaConnectionError error codes) or a %GDA_CONFIG_ERROR domain error (see the #GdaConfigError error codes).

    Parameters

    • dsn: string

      data source name.

    • authString: string

      authentication string, or %NULL

    • options: Gda.ConnectionOptions

      options for the connection (see #GdaConnectionOptions).

    Returns Gda.Connection

  • Opens a connection given a provider ID and a connection string. This allows applications to open connections without having to create a data source (DSN) in the configuration. The format of cnc_string is similar to PostgreSQL and MySQL connection strings. It is a semicolumn-separated series of <key>=<value> pairs, where each key and value are encoded as per RFC 1738, see gda_rfc1738_encode() for more information.

    The possible keys depend on the provider, the "gda-sql-5.0 -L" command can be used to list the actual keys for each installed database provider.

    For example the connection string to open an SQLite connection to a database file named "my_data.db" in the current directory would be "DB_DIR=.;DB_NAME=my_data".

    The cnc_string string must have the following format: "[<provider>://][<username>[:<password>]]<connection_params>" (if <username> and/or <password> are provided, and auth_string is %NULL, then these username and passwords will be used, and if <provider> is provided and provider_name is %NULL then this provider will be used). Note that if provided, <username>, <password> and <provider> must be encoded as per RFC 1738, see gda_rfc1738_encode() for more information.

    The auth_string must contain the authentication information for the server to accept the connection. It is a string containing semi-colon seperated named values, usually like "USERNAME=...;PASSWORD=..." where the ... are replaced by actual values. Note that each name and value must be encoded as per RFC 1738, see gda_rfc1738_encode() for more information.

    The actual named parameters required depend on the provider being used, and that list is available as the auth_params member of the #GdaProviderInfo structure for each installed provider (use gda_config_get_provider_info() to get it). Similarly to the format of the connection string, use the "gda-sql-5.0 -L" command to list the possible named parameters.

    Additionally, it is possible to have the connection string respect the "<provider_name>://<real cnc string>" format, in which case the provider name and the real connection string will be extracted from that string (note that if provider_name is not %NULL then it will still be used as the provider ID).\

    This method may fail with a GDA_CONNECTION_ERROR domain error (see the #GdaConnectionError error codes) or a %GDA_CONFIG_ERROR domain error (see the #GdaConfigError error codes).

    Parameters

    • providerName: string

      provider ID to connect to, or %NULL

    • cncString: string

      connection string.

    • authString: string

      authentication string, or %NULL

    • options: Gda.ConnectionOptions

      options for the connection (see #GdaConnectionOptions).

    Returns Gda.Connection

  • openSqlite(directory: string, filename: string, autoUnlink: boolean): Gda.Connection
  • Opens an SQLite connection even if the SQLite provider is not installed, to be used by database providers which need a temporary database to store some information.

    Parameters

    • directory: string

      the directory the database file will be in, or %NULL for the default TMP directory

    • filename: string

      the database file name

    • autoUnlink: boolean

      if %TRUE, then the database file will be removed afterwards

    Returns Gda.Connection

  • stringSplit(string: string, outCncParams: string, outProvider: string, outUsername: string, outPassword: string): void
  • Extract the provider, connection parameters, 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 provider, username and password strings are correctly decoded.

    For example all the following connection strings:

    will return the following new strings (double quotes added here to delimit strings):

    Parameters

    • string: string

      a string in the "[<provider>://][<username>[:<password>]]<connection_params>" form

    • outCncParams: string

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

    • outProvider: string

      a place to store the new string containing the <provider> 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, or %NULL

    Returns void

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