Copyright © 2010-2014 Alexei Krasnopolski
Version: 1.2.4
Introduced in: 2012-12-17
Authors: Alexei Krasnopolski (krasnop@bellsouth.net) [web site: http://krasnopolski.org/].
References
close_statement/2 | The command closes prepared statement and frees corresponded resources on server. |
connection_record/1 | Returns #connection{} record decribed given connection. |
execute_query/2 | Executes SQL query and return a tuple of field metadata information and list of result rows. |
execute_statement/4 | Executes prepared statement represented with Handler. |
execute_statement/6 | The same as execute_statement/4 except parameter New. |
fetch_statement/4 | Fetchs data from a cursor that was created by statement execution. |
get_field_list/3 | Returns list of field metadata records for table 'Table_name'. |
get_prepared_statement_handle/2 | The same is prepare_statement/2 but it has short return: just a handle of a prepared statement. |
is_open/1 | Returns true if connection is open and healthy. |
prepare_statement/2 | Send command to prepare statement. |
reset_statement/2 | Resets prepared statement and removes all cashed data on server. |
send_statement_long_parameter/4 | Sends parameter of prepered statement to SQL server before statement execution. |
transaction/2 | executes a transaction. |
connection_record(Connection_pid::pid()) -> #connection{} | #mysql_error{}
Returns #connection{} record decribed given connection.
is_open(Connection_pid::pid()) -> true | false
Returns true if connection is open and healthy.
execute_query(Connection_pid::pid(), Query::string()) -> Result
Executes SQL query and return a tuple of field metadata information and list of result rows.
See also: packet_response:handle_response/2.
get_field_list(Connection_pid::pid(), Table_name::string(), Column_name::string()) -> Result
Returns list of field metadata records for table 'Table_name'. Column_name is requalar expression using symbols % and _ to filter column names for return.
prepare_statement(Connection_pid::#connection{}, Statement::string()) -> Result
Send command to prepare statement. Returns #ok_stmt_packet.stmt_handle handle of prepared statement that will be used for followed operation with the statement.
get_prepared_statement_handle(Connection_pid::pid(), Statement::string()) -> integer()
The same is prepare_statement/2 but it has short return: just a handle of a prepared statement.
send_statement_long_parameter(Connection_pid, Handle, Parameter_index, Parameter) -> any()
Sends parameter of prepered statement to SQL server before statement execution.
execute_statement(Connection_pid, Handle, Parameter_types, Parameters) -> Result
Executes prepared statement represented with Handler. Parameters will replace '?' placeholders in prepared statement. Parameter_types list passes types for each parameter. Returns result as a list of data rows.
See also: execute_statement/5.
execute_statement(Connection_pid, Handle, Parameter_types, Parameters, Flags, New) -> Result
Equivalent to execute_statement / 4.
The same as execute_statement/4 except parameter New. The New equals true forces command send parameter types to server.
close_statement(Connection_pid::pid(), Handle::integer()) -> {Metadata::#metadata{}, []} | #mysql_error{}
The command closes prepared statement and frees corresponded resources on server.
reset_statement(Connection_pid::pid(), Handle::integer()) -> {Metadata::#metadata{}, []} | #mysql_error{}
Resets prepared statement and removes all cashed data on server.
fetch_statement(Connection_pid, Handle, Metadata, Row_number) -> Result
Fetchs data from a cursor that was created by statement execution.
transaction(Connection_pid::pid(), F::function()) -> any() | #mysql_error{type = transaction}
executes a transaction. F represents a function with sequence of queries under the transaction management. (f.e F = fun(Connection) -> my:execute_query(...), ... end). The function returns result of F/1 if transaction is successful and returns #mysql_error{} if transaction was rollbacked.
Generated by EDoc, Mar 19 2014, 23:27:00.