From 25a06cde64b35edcb7c86ed1be934dc39a1f0e79 Mon Sep 17 00:00:00 2001 From: "matthias@arch" Date: Thu, 11 May 2023 13:05:53 +0200 Subject: [PATCH] Added replace_null --- regina/utility/sql_util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/regina/utility/sql_util.py b/regina/utility/sql_util.py index de06c9b..b399705 100644 --- a/regina/utility/sql_util.py +++ b/regina/utility/sql_util.py @@ -1,5 +1,11 @@ import sqlite3 as sql """Various utilities""" + +def replace_null(s): + if not s: + return "None" + return s + def sanitize(s): if type(s) != str: return s return s.replace("'", r"''").strip(" ")