Module tenlib.transform.sql

Functions

def addslashes_single(data: str)

Replaces characters that need to be escaped in a backslash-escaped single quote string. Those characters are:

  • '
  • \
  • \n
  • \t
  • \r
  • \0
def addslashes_double(data: str)

Replaces characters that need to be escaped in a backslash-escaped double quote string. Those characters are:

  • "
  • \
  • \n
  • \t
  • \r
  • \0
def xstring(data: bytes)

ABC -> X'414243'

def singlequote(data: str) ‑> str

ABC'DEF -> 'ABC''DEF'

def doublequote(data: str) ‑> str

ABC"DEF -> "ABC""DEF"

def ord(data: bytes) ‑> list[int]

b'ABC' -> [65, 66, 67]

def sum_chr(data: bytes) ‑> str
def sum_char(data: bytes) ‑> str
def pipes_chr(data: bytes) ‑> str
def pipes_char(data: bytes) ‑> str
def concat_char(data: bytes) ‑> str
def concat_chr(data: bytes) ‑> str
def hexadecimal(data: bytes) ‑> str