Coverage for src/fluree_py/http/protocol/endpoint/query.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-04-02 03:03 +0000

1"""Protocols and types for building and executing queries in the Fluree ledger.""" 

2 

3from typing import ( 

4 Protocol, 

5 Self, 

6) 

7 

8from fluree_py.http.protocol.mixin import ( 

9 SupportsCommitable, 

10 SupportsContext, 

11 SupportsRequestCreation, 

12 SupportsWhere, 

13) 

14from fluree_py.types.query.select import SelectArray, SelectObject 

15from fluree_py.types.query.query import ( 

16 OrderByClause, 

17 ActiveIdentity, 

18 GroupByClause, 

19 HavingClause, 

20) 

21 

22 

23class QueryBuilder( 

24 SupportsContext["QueryBuilder"], 

25 SupportsWhere["QueryBuilder"], 

26 SupportsRequestCreation, 

27 SupportsCommitable, 

28 Protocol, 

29): 

30 """Protocol for building query operations.""" 

31 

32 def with_order_by(self, fields: OrderByClause) -> Self: ... 

33 def with_opts(self, opts: ActiveIdentity) -> Self: ... 

34 def with_select(self, fields: SelectObject | SelectArray) -> Self: ... 

35 def with_group_by(self, fields: GroupByClause) -> Self: ... 

36 def with_having(self, condition: HavingClause) -> Self: ...