B:BD[
7.214] → [
7.214:313]
dbo.exec_oneshot('create table if not exists irc_servers (netname text primary key, hostname text, nick text)')
dbo.exec_oneshot('create table if not exists irc_channels (channel text primary key, netname text)')
dbo.exec_oneshot('create table if not exists matrix_rooms (room_id text primary key, name text)')
return dbo
db.create_table('irc_servers', ['netname text primary key', 'hostname text', 'nick text'])
db.create_table('irc_channels', ['channel text primary key', 'netname text'])
db.create_table('matrix_rooms', ['room_id text primary key', 'name text'])
return db
}
pub fn (mut self Db) create_table(table string, fields []string) {
self.exec_oneshot('create table if not exists $table (${fields.join(',')})')