neuralib.sqlp.stat.SqlStat

class neuralib.sqlp.stat.SqlStat[source]

Bases: Generic[T]

Abstract SQL statement.

__init__(table)[source]
Parameters:

table (type[T] | None)

Methods

__init__(table)

add(stat)

Add SQL token.

build()

build a SQL statement.

drop()

submit()

build the SQL statement and execute.

__init__(table)[source]
Parameters:

table (type[T] | None)

build()[source]

build a SQL statement.

Return type:

tuple[str, list]

submit()[source]

build the SQL statement and execute.

Returns:

a cursor

Raises:

RuntimeError – current statement does not bind with a connection.

Return type:

Cursor[T]

drop()[source]
add(stat)[source]

Add SQL token.

Return type:

Self