Added replace_null

This commit is contained in:
matthias@arch 2023-05-11 13:05:53 +02:00
parent 818feac63f
commit 25a06cde64

View File

@ -1,5 +1,11 @@
import sqlite3 as sql import sqlite3 as sql
"""Various utilities""" """Various utilities"""
def replace_null(s):
if not s:
return "None"
return s
def sanitize(s): def sanitize(s):
if type(s) != str: return s if type(s) != str: return s
return s.replace("'", r"''").strip(" ") return s.replace("'", r"''").strip(" ")