2020-02-02 14:39:57 +03:00
|
|
|
module mysql
|
|
|
|
|
2020-11-02 00:15:33 +03:00
|
|
|
[typedef]
|
2020-10-19 21:11:04 +03:00
|
|
|
struct C.MYSQL {
|
|
|
|
}
|
|
|
|
|
2020-11-02 00:15:33 +03:00
|
|
|
[typedef]
|
2020-10-19 21:11:04 +03:00
|
|
|
struct C.MYSQL_RES {
|
|
|
|
}
|
|
|
|
|
2020-11-02 00:15:33 +03:00
|
|
|
[typedef]
|
2020-02-02 14:39:57 +03:00
|
|
|
struct C.MYSQL_FIELD {
|
2020-10-19 21:11:04 +03:00
|
|
|
name byteptr // Name of column
|
|
|
|
org_name byteptr // Original column name, if an alias
|
|
|
|
table byteptr // Table of column if column was a field
|
|
|
|
org_table byteptr // Org table name, if table was an alias
|
|
|
|
db byteptr // Database for table
|
|
|
|
catalog byteptr // Catalog for table
|
|
|
|
def byteptr // Default value (set by mysql_list_fields)
|
2021-01-09 11:40:21 +03:00
|
|
|
length int // Width of column (create length)
|
|
|
|
max_length int // Max width for selected set
|
2020-02-02 14:39:57 +03:00
|
|
|
name_length u32
|
|
|
|
org_name_length u32
|
|
|
|
table_length u32
|
|
|
|
org_table_length u32
|
|
|
|
db_length u32
|
|
|
|
catalog_length u32
|
|
|
|
def_length u32
|
2020-10-19 21:11:04 +03:00
|
|
|
flags u32 // Div flags
|
|
|
|
decimals u32 // Number of decimals in field
|
|
|
|
charsetnr u32 // Character set
|
|
|
|
@type int // Type of field. See mysql_com.h for types
|
2020-02-02 14:39:57 +03:00
|
|
|
}
|
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_init(mysql &C.MYSQL) &C.MYSQL
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2021-03-05 17:41:11 +03:00
|
|
|
fn C.mysql_real_connect(mysql &C.MYSQL, host charptr, user charptr, passwd charptr, db charptr, port u32, unix_socket charptr, client_flag ConnectionFlag) &C.MYSQL
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_query(mysql &C.MYSQL, q byteptr) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-06-11 11:07:17 +03:00
|
|
|
fn C.mysql_real_query(mysql &C.MYSQL, q byteptr, len u32) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_select_db(mysql &C.MYSQL, db byteptr) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_change_user(mysql &C.MYSQL, user byteptr, password byteptr, db byteptr) bool
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_affected_rows(mysql &C.MYSQL) u64
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_options(mysql &C.MYSQL, option int, arg voidptr) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_get_option(mysql &C.MYSQL, option int, arg voidptr) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-06-01 12:26:39 +03:00
|
|
|
fn C.mysql_list_tables(mysql &C.MYSQL, wild byteptr) &C.MYSQL_RES
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_num_fields(res &C.MYSQL_RES) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-06-01 12:26:39 +03:00
|
|
|
fn C.mysql_num_rows(res &C.MYSQL_RES) u64
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2021-03-05 17:41:11 +03:00
|
|
|
fn C.mysql_autocommit(mysql &C.MYSQL, mode bool)
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2021-03-05 17:41:11 +03:00
|
|
|
fn C.mysql_refresh(mysql &C.MYSQL, options u32) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2021-03-05 17:41:11 +03:00
|
|
|
fn C.mysql_reset_connection(mysql &C.MYSQL) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2021-03-05 17:41:11 +03:00
|
|
|
fn C.mysql_ping(mysql &C.MYSQL) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_store_result(mysql &C.MYSQL) &C.MYSQL_RES
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_fetch_row(res &C.MYSQL_RES) &byteptr
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_fetch_fields(res &C.MYSQL_RES) &C.MYSQL_FIELD
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_free_result(res &C.MYSQL_RES)
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_real_escape_string_quote(mysql &C.MYSQL, to byteptr, from byteptr, len u64, quote byte) u64
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_close(sock &C.MYSQL)
|
2020-02-02 14:39:57 +03:00
|
|
|
|
2020-10-19 21:11:04 +03:00
|
|
|
// INFO & VERSION
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_info(mysql &C.MYSQL) byteptr
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_get_host_info(mysql &C.MYSQL) byteptr
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_get_server_info(mysql &C.MYSQL) byteptr
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_get_server_version(mysql &C.MYSQL) u64
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-02-02 14:39:57 +03:00
|
|
|
fn C.mysql_get_client_version() u64
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-02-02 14:39:57 +03:00
|
|
|
fn C.mysql_get_client_info() byteptr
|
|
|
|
|
2020-10-19 21:11:04 +03:00
|
|
|
// DEBUG & ERROR INFO
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_error(mysql &C.MYSQL) byteptr
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_errno(mysql &C.MYSQL) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-05-04 15:58:24 +03:00
|
|
|
fn C.mysql_dump_debug_info(mysql &C.MYSQL) int
|
2020-10-19 21:11:04 +03:00
|
|
|
|
2020-02-02 14:39:57 +03:00
|
|
|
fn C.mysql_debug(debug byteptr)
|