From 1428c1cc682c90ce837766d2612046d4096415eb Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 12 Mar 2017 18:51:49 +0100 Subject: [PATCH] add generation of get_xxx with DB_id as argument --- src/generation/types.anubis | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/generation/types.anubis b/src/generation/types.anubis index 5e96d94..ad6f69a 100644 --- a/src/generation/types.anubis +++ b/src/generation/types.anubis @@ -285,7 +285,19 @@ public define Maybe(One) " SQLite3DataBase db,\n"+ " Int idx\n"+ " )=\n"+ - " get_"+name+"(db, to_decimal(idx))." + " get_"+name+"(db, to_decimal(idx)).\n\n"+ + "public define Maybe("+type_name+")\n"+ + " get_"+name+"\n"+ + " (\n"+ + " SQLite3DataBase db,\n"+ + " DB_id idx\n"+ + " )=\n"+ + " if idx is\n"+ + " {\n"+ + " none then failure,\n"+ + " db_id(_idx) then get_"+name+"(db, to_decimal(_idx))\n"+ + " }"+ + ".\n\n" ) is //end of the function { failure then println("can't write generate_get_one "+type_name); failure, -- libgit2 0.21.4