@@ -100,7 +100,7 @@ async def remove_enforced_schema(cls, schema):
100100 return await cls ._run_query (query )
101101
102102 @classmethod
103- async def get_value (cls , key : Union [str , None ] = None , custom_key : Union [str , None ] = None , with_pointers : bool = False ):
103+ async def get_value (cls , key : Union [str , None ] = None , custom_key : Union [str , None ] = None , with_pointers : bool = False , key_included : bool = False , pointers_metadata : bool = False ):
104104
105105 """
106106 Args:
@@ -110,6 +110,9 @@ async def get_value(cls, key: Union[str, None] = None, custom_key: Union[str, No
110110 Returns:
111111 The value associated with the key or custom key. Class 'str' if the get operation failed.
112112 """
113+ if pointers_metadata and with_pointers :
114+ raise ValueError ("You select both pointers value and pointers metadata. Choose one" )
115+
113116 if custom_key and len (custom_key ) > 0 :
114117 key = convert_custom_key (custom_key )
115118
@@ -118,7 +121,7 @@ async def get_value(cls, key: Union[str, None] = None, custom_key: Union[str, No
118121
119122 cls .command = "get_value"
120123
121- query = convert_to_binary_query (cls , key = key , with_pointers = with_pointers )
124+ query = convert_to_binary_query (cls , key = key , with_pointers = with_pointers , key_included = key_included , pointers_metadata = pointers_metadata )
122125 return await cls ._run_query (query )
123126
124127 @classmethod
@@ -167,6 +170,7 @@ async def delete_bulk(cls, bulk_keys: list = [], bulk_custom_keys: list = []):
167170
168171 Raises:
169172 ValueError: If both `bulk_keys` and `bulk_custom_keys` are empty.
173+ ValueError: If both `pointers_metadata` and `with_pointers` are True.
170174 """
171175 if len (bulk_custom_keys ) > 0 :
172176 bulk_custom_keys = convert_custom_keys (bulk_custom_keys )
@@ -180,7 +184,7 @@ async def delete_bulk(cls, bulk_keys: list = [], bulk_custom_keys: list = []):
180184 return await cls ._run_query (query ) # Execute the query and return the result
181185
182186 @classmethod
183- async def get_bulk (cls , bulk_keys : list = [], bulk_custom_keys : list = [], limit : list = [], with_pointers : bool = False ):
187+ async def get_bulk (cls , bulk_keys : list = [], bulk_custom_keys : list = [], limit : list = [], with_pointers : bool = False , key_included : bool = False , pointers_metadata : bool = False ):
184188 """
185189 Retrieve multiple keys in bulk. Custom keys can be converted and added to the bulk retrieval list.
186190 Additionally, a limit on the number of records to retrieve can be applied, and whether to include pointers
@@ -202,7 +206,12 @@ async def get_bulk(cls, bulk_keys: list = [], bulk_custom_keys: list = [], limit
202206
203207 Raises:
204208 ValueError: If both `bulk_keys` and `bulk_custom_keys` are empty.
209+ ValueError: If both `pointers_metadata` and `with_pointers` are True.
205210 """
211+
212+ if pointers_metadata and with_pointers :
213+ raise ValueError ("You select both pointers value and pointers metadata. Choose one" )
214+
206215 if len (bulk_custom_keys ) > 0 :
207216 bulk_custom_keys = convert_custom_keys (bulk_custom_keys ) # Convert custom keys if provided
208217 bulk_keys += bulk_custom_keys
@@ -212,7 +221,7 @@ async def get_bulk(cls, bulk_keys: list = [], bulk_custom_keys: list = [], limit
212221
213222 cls .command = "get_bulk"
214223 cls .limit_output = handle_limit (limit )
215- query = convert_to_binary_query (cls , bulk_keys = bulk_keys , with_pointers = with_pointers )
224+ query = convert_to_binary_query (cls , bulk_keys = bulk_keys , with_pointers = with_pointers , key_included = key_included , pointers_metadata = pointers_metadata )
216225 return await cls ._run_query (query )
217226
218227 @classmethod
@@ -276,7 +285,7 @@ async def lookup_keys_where(cls, limit: Union[int, list] = 0, schema: Union[str,
276285 return await cls ._run_query (query )
277286
278287 @classmethod
279- async def lookup_values_where (cls , limit : Union [int , list ] = 0 , with_pointers : bool = False , schema : Union [str , None ] = None , ** filters ):
288+ async def lookup_values_where (cls , limit : Union [int , list ] = 0 , with_pointers : bool = False , key_included : bool = False , pointers_metadata : bool = False , schema : Union [str , None ] = None , ** filters ):
280289 """
281290 Perform a lookup for values matching the given filters, with options to apply a limit and include pointer information.
282291
@@ -294,14 +303,17 @@ async def lookup_values_where(cls, limit: Union[int, list] = 0, with_pointers: b
294303 # if not filters: # Ensure filters are provided for the lookup
295304 # raise ValueError("No criteria provided for the lookup.")
296305
306+ if pointers_metadata and with_pointers :
307+ raise ValueError ("You select both pointers value and pointers metadata. Choose one" )
308+
297309 if schema :
298310 cls .schema = str (schema )
299311 else :
300312 cls .schema = None
301313
302314 cls .command = "lookup_values"
303315 cls .limit_output = handle_limit (limit )
304- query = convert_to_binary_query (cls , search_criteria = filters , with_pointers = with_pointers )
316+ query = convert_to_binary_query (cls , search_criteria = filters , with_pointers = with_pointers , key_included = key_included , pointers_metadata = pointers_metadata )
305317 return await cls ._run_query (query )
306318
307319 @classmethod
0 commit comments