neuralib.sqlp.stat.SqlInsertStat
- class neuralib.sqlp.stat.SqlInsertStat[source]
Bases:
SqlStat[T],SqlReturnStat,Generic[T]- __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]
- submit(parameter=())[source]
build the SQL statement and execute.
- Returns:
a cursor
- Raises:
RuntimeError – current statement does not bind with a connection.
- Parameters:
parameter (list[T])
- Return type:
Cursor[T]
- add(stat)
Add SQL token.
- Return type:
Self
- drop()