fmt: remove the prefixed module name of const names, that are in the same module (related #22183) (#22185)

This commit is contained in:
yuyi 2024-09-10 16:25:56 +08:00 committed by GitHub
parent 234fb8e2b0
commit 008aaad999
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
284 changed files with 2539 additions and 2572 deletions

View file

@ -182,73 +182,73 @@ fn (stmt Stmt) get_field_count() u16 {
// bind_bool binds a single boolean value to the statement `stmt`
pub fn (mut stmt Stmt) bind_bool(b &bool) {
stmt.bind(mysql.mysql_type_tiny, b, 0)
stmt.bind(mysql_type_tiny, b, 0)
}
// bind_byte binds a single byte value to the statement `stmt`
pub fn (mut stmt Stmt) bind_byte(b &u8) {
stmt.bind(mysql.mysql_type_tiny, b, 0)
stmt.bind(mysql_type_tiny, b, 0)
}
// bind_u8 binds a single u8 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_u8(b &u8) {
stmt.bind(mysql.mysql_type_tiny, b, 0)
stmt.bind(mysql_type_tiny, b, 0)
}
// bind_i8 binds a single i8 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_i8(b &i8) {
stmt.bind(mysql.mysql_type_tiny, b, 0)
stmt.bind(mysql_type_tiny, b, 0)
}
// bind_i16 binds a single i16 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_i16(b &i16) {
stmt.bind(mysql.mysql_type_short, b, 0)
stmt.bind(mysql_type_short, b, 0)
}
// bind_u16 binds a single u16 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_u16(b &u16) {
stmt.bind(mysql.mysql_type_short, b, 0)
stmt.bind(mysql_type_short, b, 0)
}
// bind_int binds a single int value to the statement `stmt`
pub fn (mut stmt Stmt) bind_int(b &int) {
stmt.bind(mysql.mysql_type_long, b, 0)
stmt.bind(mysql_type_long, b, 0)
}
// bind_u32 binds a single u32 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_u32(b &u32) {
stmt.bind(mysql.mysql_type_long, b, 0)
stmt.bind(mysql_type_long, b, 0)
}
// bind_i64 binds a single i64 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_i64(b &i64) {
stmt.bind(mysql.mysql_type_longlong, b, 0)
stmt.bind(mysql_type_longlong, b, 0)
}
// bind_u64 binds a single u64 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_u64(b &u64) {
stmt.bind(mysql.mysql_type_longlong, b, 0)
stmt.bind(mysql_type_longlong, b, 0)
}
// bind_f32 binds a single f32 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_f32(b &f32) {
stmt.bind(mysql.mysql_type_float, b, 0)
stmt.bind(mysql_type_float, b, 0)
}
// bind_f64 binds a single f64 value to the statement `stmt`
pub fn (mut stmt Stmt) bind_f64(b &f64) {
stmt.bind(mysql.mysql_type_double, b, 0)
stmt.bind(mysql_type_double, b, 0)
}
// bind_text binds a single string value to the statement `stmt`
pub fn (mut stmt Stmt) bind_text(b string) {
stmt.bind(mysql.mysql_type_string, b.str, u32(b.len))
stmt.bind(mysql_type_string, b.str, u32(b.len))
}
// bind_null binds a single NULL value to the statement `stmt`
pub fn (mut stmt Stmt) bind_null() {
stmt.binds << C.MYSQL_BIND{
buffer_type: mysql.mysql_type_null
buffer_type: mysql_type_null
length: 0
}
}

View file

@ -188,7 +188,7 @@ pub fn (db &DB) q_int(query string) !int {
}
C.sqlite3_prepare_v2(db.conn, &char(query.str), query.len, &stmt, 0)
code := C.sqlite3_step(stmt)
if code != sqlite.sqlite_row {
if code != sqlite_row {
return db.error_message(code, query)
}
@ -204,7 +204,7 @@ pub fn (db &DB) q_string(query string) !string {
}
C.sqlite3_prepare_v2(db.conn, &char(query.str), query.len, &stmt, 0)
code := C.sqlite3_step(stmt)
if code != sqlite.sqlite_row {
if code != sqlite_row {
return db.error_message(code, query)
}
@ -220,7 +220,7 @@ pub fn (db &DB) exec(query string) ![]Row {
C.sqlite3_finalize(stmt)
}
mut code := C.sqlite3_prepare_v2(db.conn, &char(query.str), query.len, &stmt, 0)
if code != sqlite.sqlite_ok {
if code != sqlite_ok {
return db.error_message(code, query)
}
@ -259,7 +259,7 @@ pub fn (db &DB) exec_one(query string) !Row {
if rows.len == 0 {
return &SQLError{
msg: 'No rows'
code: sqlite.sqlite_done
code: sqlite_done
}
}
res := rows[0]
@ -314,7 +314,7 @@ pub fn (db &DB) exec_param_many(query string, params []string) ![]Row {
mut rows := []Row{}
for {
res = C.sqlite3_step(stmt)
if res != sqlite.sqlite_row {
if res != sqlite_row {
if rows.len == 0 && is_error(res) {
return db.error_message(res, query)
}