From 6c7d3b97fcf58d3240a10f96f660fee437be74dc Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 10 Jun 2017 17:23:48 +0200 Subject: [PATCH] add to_DB_id, which convert an Int into DB_id type --- database/db_types.anubis | 12 ++++++++++++ 1 file changed, 12 insertions(+), 0 deletions(-) diff --git a/database/db_types.anubis b/database/db_types.anubis index b1874b4..e2722c1 100644 --- a/database/db_types.anubis +++ b/database/db_types.anubis @@ -67,6 +67,18 @@ public define Int none then (Int)-1, db_id(_idx) then _idx }. + +public define DB_id + to_DB_id + ( + Int value + )= + if value < 0 then + none + else + db_id(value) +. + public define String to_String -- libgit2 0.21.4