From 1fb914b99b50133d1e5ecf42399b997683970ecd Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 4 May 2024 12:05:41 +0900 Subject: [PATCH] [~] to_String from DB_id return NULL instead of none. This allow to use it directly in SQL query instead of "none" which produce an error [+] add to_SQL from DB_id wich return result as to_String --- database/db_types.anubis | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/database/db_types.anubis b/database/db_types.anubis index dccf877..7af3b98 100644 --- a/database/db_types.anubis +++ b/database/db_types.anubis @@ -87,10 +87,21 @@ public define String )= if idx is { - none then "none", + none then "NULL", db_id(_idx) then abs_to_decimal(_idx) }. +public define String + to_SQL + ( + DB_id idx + )= + if idx is + { + none then "NULL", + db_id(_idx) then abs_to_decimal(_idx) + }. + public define Maybe(Int) to_mb_Int ( -- libgit2 0.21.4