namespace eval db::networks {}
proc db::networks::ls {db} {
set ret {}
$db eval {SELECT rowid as id, * FROM networks;} network {
set ndict {}
foreach k $network(*) {
dict set ndict $k [set network($k)]
}
lappend ret $ndict
}
return $ret
}
proc db::networks::add {db name servers} {
$db eval {INSERT INTO networks VALUES ($name $servers);}
}