neuralib.sqlp.stat
- class neuralib.sqlp.stat.SqlStat[source]
Abstract SQL statement.
- class neuralib.sqlp.stat.SqlSelectStat[source]
SELECT statement.
- windows(*windows, **window_ks)[source]
define windows.
- Parameters:
windows (SqlWindowDef | SqlAlias[SqlWindowDef])
window_ks (SqlWindowDef)
- Return type:
Self
- BY
alias of
Literal[‘left’, ‘right’, ‘inner’, ‘full outer’, ‘cross’]
- join(constraint: Callable | ForeignConstraint, *, by: BY = None) SqlSelectStat[tuple][source]
- join(table: type[S] | SqlAlias[S], constraint: Callable | ForeignConstraint, *, by: BY = None) SqlSelectStat[tuple]
- join(table: type[S] | SqlSelectStat[S] | SqlAlias[S] | SqlCteExpr, *field: bool | Any, by: BY = None) SqlSelectStat[tuple]
- join(*field: bool | Any, by: BY = None) SqlSelectStat[tuple]
JOINhttps://www.sqlite.org/lang_select.html#strange_join_names>>> select_from(A.a, B.b).join(A.a == B.a) SELECT A.a, B.b FROM A JOIN B ON A.a = B.a
- group_by(*by)[source]
GROUP BYhttps://www.sqlite.org/lang_select.html#resultset- Return type:
Self
- having(*exprs)[source]
HAVINGhttps://www.sqlite.org/lang_select.html#resultset- Parameters:
exprs (bool | SqlExpr)
- Return type:
Self
- intersect(stat)[source]
INTERSECThttps://www.sqlite.org/lang_select.html#compound_select_statements- Parameters:
stat (SqlStat)
- Return type:
Self
- union(stat, all=False)[source]
UNIONhttps://www.sqlite.org/lang_select.html#compound_select_statements- Parameters:
stat (SqlStat)
- Return type:
Self
- except_(stat)[source]
EXCEPThttps://www.sqlite.org/lang_select.html#compound_select_statements- Parameters:
stat (SqlStat)
- Return type:
Self
- class neuralib.sqlp.stat.SqlInsertStat[source]
- __init__(table, fields=None, *, named=False)[source]
- Parameters:
table (type[T])
fields (list[str] | None)
named (bool)
- select_from(table: type[T], *, distinct: bool = False) SqlSelectStat[T][source]
- select_from(*field, distinct: bool = False, from_table: str | type | SqlAlias | SqlSelectStat = None) SqlSelectStat[tuple]
- on_conflict(*conflict, where=None)[source]
- Parameters:
where (bool | SqlCompareOper)
- Return type:
SqlUpsertStat[T]
- returning(*expr)[source]
- Parameters:
expr (str | SqlExpr)
- Return type:
SqlInsertStat[tuple]
- class neuralib.sqlp.stat.SqlUpdateStat[source]
- from_(query)[source]
- Parameters:
query (SqlStat | SqlAlias[SqlSubQuery])
- Return type:
Self