Commit 1428c1cc682c90ce837766d2612046d4096415eb

Authored by totoro
1 parent 80c9c10d

add generation of get_xxx with DB_id as argument

Showing 1 changed file with 13 additions and 1 deletions   Show diff stats
src/generation/types.anubis
@@ -285,7 +285,19 @@ public define Maybe(One) @@ -285,7 +285,19 @@ public define Maybe(One)
285 " SQLite3DataBase db,\n"+ 285 " SQLite3DataBase db,\n"+
286 " Int idx\n"+ 286 " Int idx\n"+
287 " )=\n"+ 287 " )=\n"+
288 - " get_"+name+"(db, to_decimal(idx))." 288 + " get_"+name+"(db, to_decimal(idx)).\n\n"+
  289 + "public define Maybe("+type_name+")\n"+
  290 + " get_"+name+"\n"+
  291 + " (\n"+
  292 + " SQLite3DataBase db,\n"+
  293 + " DB_id idx\n"+
  294 + " )=\n"+
  295 + " if idx is\n"+
  296 + " {\n"+
  297 + " none then failure,\n"+
  298 + " db_id(_idx) then get_"+name+"(db, to_decimal(_idx))\n"+
  299 + " }"+
  300 + ".\n\n"
289 ) is //end of the function 301 ) is //end of the function
290 { 302 {
291 failure then println("can't write generate_get_one "+type_name); failure, 303 failure then println("can't write generate_get_one "+type_name); failure,