Remove old Prefs type-checking code
This commit is contained in:
parent
25a6590a56
commit
68cf8216b7
1 changed files with 0 additions and 11 deletions
|
@ -4,17 +4,6 @@ import norm/sqlite
|
||||||
import prefs_impl, types
|
import prefs_impl, types
|
||||||
export genUpdatePrefs
|
export genUpdatePrefs
|
||||||
|
|
||||||
static:
|
|
||||||
var pFields: seq[string]
|
|
||||||
for id in getTypeImpl(Prefs)[2]:
|
|
||||||
if $id[0] == "id": continue
|
|
||||||
pFields.add $id[0]
|
|
||||||
|
|
||||||
let pDefs = toSeq(allPrefs()).mapIt(it.name)
|
|
||||||
let missing = pDefs.filterIt(it notin pFields)
|
|
||||||
if missing.len > 0:
|
|
||||||
raiseAssert("{$1} missing from the Prefs type" % missing.join(", "))
|
|
||||||
|
|
||||||
template safeAddColumn(field: typedesc): untyped =
|
template safeAddColumn(field: typedesc): untyped =
|
||||||
try: field.addColumn
|
try: field.addColumn
|
||||||
except DbError: discard
|
except DbError: discard
|
||||||
|
|
Loading…
Reference in a new issue