src/evsql.h
changeset 27 461be4cd34a3
parent 26 61668c57f4bb
child 28 e944453ca924
equal deleted inserted replaced
26:61668c57f4bb 27:461be4cd34a3
   173  * Same as evsql_query, but uses the SQL-level support for binding parameters.
   173  * Same as evsql_query, but uses the SQL-level support for binding parameters.
   174  */
   174  */
   175 struct evsql_query *evsql_query_params (struct evsql *evsql, struct evsql_trans *trans, const char *command, const struct evsql_query_params *params, evsql_query_cb query_fn, void *cb_arg);
   175 struct evsql_query *evsql_query_params (struct evsql *evsql, struct evsql_trans *trans, const char *command, const struct evsql_query_params *params, evsql_query_cb query_fn, void *cb_arg);
   176 
   176 
   177 /*
   177 /*
       
   178  * Abort a query, the query callback will not be called, the query and any possible results will be discarded.
       
   179  *
       
   180  * This does not garuntee that the query will not execute, simply that you won't get the results.
       
   181  *
       
   182  * If the query is part of a transaction, then trans must be given, and the query must be the query that is currently
       
   183  * executing on that trans. The transaction's ready_fn will be called once the query has been aborted.
       
   184  */
       
   185 void evsql_query_abort (struct evsql_trans *trans, struct evsql_query *query);
       
   186 
       
   187 /*
   178  * Commit a transaction, calling done_fn if it was succesfull (error_fn otherwise).
   188  * Commit a transaction, calling done_fn if it was succesfull (error_fn otherwise).
       
   189  *
       
   190  * trans must be idle, just like for evsql_query.
       
   191  *
       
   192  * You cannot abort a COMMIT, calling trans_abort on trans after a succesful trans_commit is a FATAL error.
   179  */
   193  */
   180 int evsql_trans_commit (struct evsql_trans *trans);
   194 int evsql_trans_commit (struct evsql_trans *trans);
   181 
   195 
   182 /*
   196 /*
   183  * Abort a transaction, rolling it back. No callbacks will be called, unless this function returns nonzero, in which
   197  * Abort a transaction, rolling it back. No callbacks will be called.
   184  * case error_fn might be called.
   198  *
   185  */
   199  * You cannot abort a COMMIT, calling trans_abort on trans after a succesful trans_commit is a FATAL error.
   186 int evsql_trans_abort (struct evsql_trans *trans);
   200  */
       
   201 void evsql_trans_abort (struct evsql_trans *trans);
   187 
   202 
   188 /*
   203 /*
   189  * Transaction-handling functions
   204  * Transaction-handling functions
   190  */
   205  */
   191 
   206