luminadb.models.query_builder module

Model QueryBuilder

class luminadb.models.query_builder.QueryBuilder(model: Type[T])[source]

Bases: Generic[T]

Query builder for Model ORM

count() int[source]

Count how much data is within this operation

delete()[source]

Delete data based on the filter

fetch() list[T][source]

Fetch data from table

fetch_one() T | None[source]

Fetch one data from table

limit(value: int)[source]

Sets limit

offset(value: int)[source]

Sets offset

order_by(column: str, descending: bool = False)[source]

Order the query by a column

patch(**kwargs: Any)[source]

Update a data based on the filter according to passed keyword args

throw()[source]

Set when fetch() returns nothing, will raise an error

update(**kwargs: Any)

Update a data based on the filter according to passed keyword args

where(**kwargs: Any)[source]

Sets conditioning

luminadb.models.query_builder.add_excnote(exc: Exception)[source]

Add exception notes when an entry retrieved is different