1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

mysql: add more documentation (#7846)

This commit is contained in:
Don Alfons Nisnoni
2021-01-09 16:40:21 +08:00
committed by GitHub
parent 256ddcee1f
commit d645e45752
6 changed files with 192 additions and 173 deletions

View File

@@ -1,21 +1,21 @@
module mysql
// get_error_msg returns error message from MySQL instance.
// get_error_msg - returns error message from MySQL instance.
fn get_error_msg(conn &C.MYSQL) string {
return unsafe {C.mysql_error(conn).vstring()}
return unsafe { C.mysql_error(conn).vstring() }
}
// get_errno returns error number from MySQL instance.
// get_errno - returns error number from MySQL instance.
fn get_errno(conn &C.MYSQL) int {
return C.mysql_errno(conn)
}
// resolve_nil_str returns empty string if passed value is a nil pointer.
// resolve_nil_str - returns an empty string if passed value is a nil pointer.
fn resolve_nil_str(ptr byteptr) string {
if isnil(ptr) {
return ''
}
return unsafe {ptr.vstring()}
return unsafe { ptr.vstring() }
}
[inline]