MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / install_regexp_functions

Function install_regexp_functions

tortoise/contrib/sqlite/regex.py:32–42  ·  view source on GitHub ↗
(connection: aiosqlite.Connection)

Source from the content-addressed store, hash-verified

30
31
32async def install_regexp_functions(connection: aiosqlite.Connection):
33 def regexp(expr, item):
34 if not expr or not item:
35 return False
36 return re.search(expr, item) is not None
37
38 def iregexp(expr, item):
39 return re.search(expr, item, re.IGNORECASE) is not None
40
41 await connection.create_function("regexp", 2, regexp)
42 await connection.create_function("match", 2, iregexp)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…