This commit is contained in:
2025-11-25 05:13:02 +01:00
parent 803828e808
commit 43eb15be7a
4 changed files with 47 additions and 44 deletions

View File

@@ -15,8 +15,8 @@ pub mut:
// new creates a new database connection
pub fn Database.new(host string, port int) !Database {
mut db := Database{
host: host
port: port
host: host
port: port
connected: false
}
return db
@@ -36,7 +36,7 @@ pub fn (mut db Database) disconnect() ! {
}
// query executes a database query
pub fn (db &Database) query(sql string) ![]map[string]string {
pub fn (db &Database) query(ssql string) ![]map[string]string {
if !db.connected {
return error('database not connected')
}
@@ -46,4 +46,4 @@ pub fn (db &Database) query(sql string) ![]map[string]string {
// execute_command executes a command and returns rows affected
pub fn (db &Database) execute_command(cmd string) !int {
return 0
}
}