Registry, tw interface draft, sub handler

This commit is contained in:
2026-07-25 09:49:42 +03:00
parent 67a04ef82f
commit fc5c3d07e4
4 changed files with 384 additions and 4 deletions
+21
View File
@@ -0,0 +1,21 @@
from typing import Any
from psycopg import sql
from data import RawExpr, Expression
def LOWER(expression: Expression) -> RawExpr:
"""
Wrap an Expression in the SQL function LOWER().
"""
expr, values = expression.as_tuple()
final_expr = sql.SQL("LOWER({})").format(expr)
final_values = values
return RawExpr(final_expr, final_values)
def asexpr(value: Any) -> RawExpr:
"""
Turn a value into an expression.
"""
return RawExpr(sql.Placeholder(), (value,))