neuralib.sqlp.expr

class neuralib.sqlp.expr.SqlExpr
between(value, value2=None)
Return type:

SqlCompareOper

cast(t)
Parameters:

t (type)

Return type:

SqlExpr

contains(value)
Parameters:

value (Union[Sequence, SqlStat])

Return type:

SqlCompareOper

glob(value)
Parameters:

value (str)

Return type:

SqlCompareOper

is_not_null()
Return type:

SqlCompareOper

is_null()
Return type:

SqlCompareOper

like(value)
Parameters:

value (str)

Return type:

SqlCompareOper

not_between(value, value2=None)
Return type:

SqlCompareOper

not_contains(value)
Parameters:

value (Union[Sequence, SqlStat])

Return type:

SqlCompareOper

not_like(value)
Parameters:

value (str)

Return type:

SqlCompareOper

neuralib.sqlp.expr.wrap(other)
Parameters:

other (Any)

Return type:

SqlExpr

neuralib.sqlp.expr.wrap_seq(*other)
Return type:

list[SqlExpr]

neuralib.sqlp.expr.eval_expr(expr, data)
Parameters:

expr (SqlExpr | Any)

Return type:

Any

neuralib.sqlp.expr.use_table_first(expr)
Parameters:

expr (SqlExpr)

Return type:

type | None

neuralib.sqlp.expr.use_table(expr, self)
Parameters:
Return type:

type | SqlAlias[type] | None

class neuralib.sqlp.expr.SqlLiteral
value
SQL_FALSE: SqlLiteral = FALSE
SQL_NULL: SqlLiteral = NULL
SQL_TRUE: SqlLiteral = TRUE
__init__(value)
Parameters:

value (str)

class neuralib.sqlp.expr.SqlPlaceHolder
value
__init__(value)
class neuralib.sqlp.expr.SqlField
field
__init__(field)
Parameters:

field (Field)

property name: str
property table: type
property table_name: str
class neuralib.sqlp.expr.SqlAlias
__init__(value, name)
Parameters:
  • value (E | type[E])

  • name (str)

class neuralib.sqlp.expr.SqlAliasField
table
name
attr
__init__(table, name, attr)
Parameters:
class neuralib.sqlp.expr.SqlSubQuery

https://www.sqlite.org/lang_expr.html#subquery_expressions

stat
__init__(stat)
Parameters:

stat (SqlStat)

class neuralib.sqlp.expr.SqlOper
oper
__init__(oper)
Parameters:

oper (str)

class neuralib.sqlp.expr.SqlOrderOper
oper
right
__init__(oper, right)
Parameters:
nulls_first()
Return type:

Self

nulls_last()
Return type:

Self

class neuralib.sqlp.expr.SqlCastOper
oper
right
__init__(oper, right)
Parameters:
class neuralib.sqlp.expr.SqlCompareOper
oper
left
right
__init__(oper, left, right)
Parameters:
  • oper (str)

  • left (SqlExpr)

  • right (Any)

classmethod as_set_expr(expr)
Parameters:

expr (SqlCompareOper)

Return type:

SqlCompareOper

not_()
Return type:

SqlCompareOper

class neuralib.sqlp.expr.SqlUnaryOper
oper
right
__init__(oper, right)
Parameters:
class neuralib.sqlp.expr.SqlBinaryOper
oper
left
right
__init__(oper, left, right)
Parameters:
class neuralib.sqlp.expr.SqlFuncOper
oper
args
__init__(oper, func, *args)
Parameters:

oper (str)

class neuralib.sqlp.expr.SqlVarArgOper
oper
args
__init__(oper, args)
Parameters:
not_()
Return type:

SqlVarArgOper

class neuralib.sqlp.expr.SqlConcatOper
args
__init__(args, oper='||')
Parameters:

args (list[SqlExpr])

class neuralib.sqlp.expr.SqlExistsOper

https://www.sqlite.org/lang_expr.html#the_exists_operator

oper
stat
__init__(oper, stat)
Parameters:
  • oper (Literal['EXISTS', 'NOT EXISTS'])

  • stat (SqlStat)

class neuralib.sqlp.expr.SqlAggregateFunc
oper
args
__init__(oper, *args)
Parameters:

oper (str)

distinct()
Return type:

Self

where(*args)
Parameters:

args (bool | SqlExpr)

Return type:

Self

class neuralib.sqlp.expr.SqlWindowDef
__init__(name=None)
Parameters:

name (str | None)

frame(on)
over(*, order_by=None, partition_by=None)
Return type:

Self

class neuralib.sqlp.expr.SqlWindowFunc
oper
args
__init__(oper, *args)
Parameters:

oper (str)

over(name=None, *, order_by=None, partition_by=None)
Parameters:

name (str | None)

Return type:

Self

class neuralib.sqlp.expr.SqlCaseExpr

https://www.sqlite.org/lang_expr.html#the_case_expression

expr
cases
__init__(expr=None)
Parameters:

expr (SqlExpr | None)

else_(then)
Return type:

Self

when(case, then)
Return type:

Self

class neuralib.sqlp.expr.SqlCteExpr
__init__(name, select)
Parameters: