mg_session_run

Submits a query to the server for execution.

All records from the previous query must be pulled before executing the next query.

extern (C) @safe @nogc pure nothrow
mg_session_run
(,
const char* query
,
const mg_map* params
,,,
long* qid
)

Parameters

query char*

Query string.

params mg_map*

A mg_map containing query parameters. NULL can be supplied instead of an empty parameter map.

columns mg_list**

Names of the columns output by the query execution will be stored in here. This is the same as the value obtained by mg_result_columns on a pulled mg_result. NULL can be supplied if we're not interested in the columns names.

extra_run_information mg_map*

A mg_map containing extra information for running the statement. It can contain the following information: - bookmarks - list of strings containing some kind of bookmark identification - tx_timeout - integer that specifies a transaction timeout in ms. - tx_metadata - dictionary taht can contain some metadata information, mainly used for logging. - mode - specifies what kind of server is the run targeting. For write access use "w" and for read access use "r". Defaults to write access. - db - specifies the database name for multi-database to select where the transaction takes place. If no db is sent or empty string it implies that it is the default database.

qid long*

QID for the statement will be stored in here if an Explicit transaction was started. Return: Returns 0 if query was submitted for execution successfuly. Otherwise, a non-zero error code is returned.

Meta