~aleteoryx/tclircc

ref: 3a97dad35c3ce996e0b1df7ddcf6bffc03f22cd3 tclircc/src/db/networks.tcl -rw-r--r-- 375 bytes
3a97dad3Aleteoryx sqlite3 debump for debian environment 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);}
}