Skip to content

Commit 63a181c

Browse files
adding base64 to api too
1 parent d6a6bf3 commit 63a181c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pioreactorui/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
)
5757

5858

59+
def decode_base64(string: str) -> str:
60+
return loads(string)
61+
62+
5963
def create_app():
6064
from .unit_api import unit_api
6165
from .api import api
@@ -142,6 +146,10 @@ def _get_app_db_connection():
142146
db = getattr(g, "_app_database", None)
143147
if db is None:
144148
db = g._app_database = sqlite3.connect(pioreactor_config.get("storage", "database"))
149+
db.create_function(
150+
"BASE64", 1, decode_base64
151+
) # TODO: until next OS release which implements a native sqlite3 base64 function
152+
145153
db.row_factory = _make_dicts
146154
db.execute("PRAGMA foreign_keys = 1")
147155

0 commit comments

Comments
 (0)