summary refs log tree commit diff stats
path: root/examples/cross_todo/nim_backend/testbackend.nim
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cross_todo/nim_backend/testbackend.nim')
-rw-r--r--examples/cross_todo/nim_backend/testbackend.nim13
1 files changed, 2 insertions, 11 deletions
diff --git a/examples/cross_todo/nim_backend/testbackend.nim b/examples/cross_todo/nim_backend/testbackend.nim
index 6754f013a..4a71d5f2c 100644
--- a/examples/cross_todo/nim_backend/testbackend.nim
+++ b/examples/cross_todo/nim_backend/testbackend.nim
@@ -2,8 +2,7 @@
 
 import backend, db_sqlite, strutils, times
 
-
-proc showPagedResults(conn: DbConn; params: TPagedParams) =
+proc showPagedResults(conn: DbConn; params: PagedParams) =
   ## Shows the contents of the database in pages of specified size.
   ##
   ## Hmm... I guess this is more of a debug proc which should be moved outside,
@@ -11,7 +10,6 @@ proc showPagedResults(conn: DbConn; params: TPagedParams) =
   var
     page = 0'i64
     rows = conn.getPagedTodos(params)
-
   while rows.len > 0:
     echo("page " & $page)
     for row in rows:
@@ -25,7 +23,6 @@ proc showPagedResults(conn: DbConn; params: TPagedParams) =
     else:
       break
 
-
 proc dumTest() =
   let conn = openDatabase("todo.sqlite3")
   try:
@@ -35,10 +32,8 @@ proc dumTest() =
       # Fill some dummy rows if there are not many entries yet.
       discard conn.addTodo(3, "Filler1")
       discard conn.addTodo(4, "Filler2")
-
     var todo = conn.addTodo(2, "Testing")
     echo("New todo added with id " & $todo.getId)
-
     # Try changing it and updating the database.
     var clonedTodo = conn.getTodo(todo.getId)[]
     assert(clonedTodo.text == todo.text, "Should be equal")
@@ -49,13 +44,11 @@ proc dumTest() =
       echo("Updated priority $1, done $2" % [$todo.priority, $todo.isDone])
     else:
       assert(false, "Uh oh, I wasn't expecting that!")
-
     # Verify our cloned copy is different but can be updated.
     assert(clonedTodo.text != todo.text, "Should be different")
     discard clonedTodo.update(conn)
     assert(clonedTodo.text == todo.text, "Should be equal")
-
-    var params: TPagedParams
+    var params: PagedParams
     params.initDefaults
     conn.showPagedResults(params)
     conn.deleteTodo(todo.getId)
@@ -66,7 +59,6 @@ proc dumTest() =
       echo("Later priority $1, done $2" % [$todo.priority, $todo.isDone])
     else:
       echo("Can't update object $1 from db!" % $todo.getId)
-
     # Try to list content in a different way.
     params.pageSize = 5
     params.priorityAscending = true
@@ -77,7 +69,6 @@ proc dumTest() =
     conn.close
     echo("Database closed")
 
-
 # Code that will be run only on the commandline.
 when isMainModule:
   dumTest()