
    LKi?                         S SK Jr  S SKJrJrJr  S SKJr  S SKJ	r	J
r
  S SKJr  S SKJrJrJrJrJrJrJrJrJrJr  S SKJrJrJr   " S S	\5      rg
)    )abstractmethod)OptionalSequenceTuple)UUID)CreateCollectionConfigurationUpdateCollectionConfiguration)Schema)

CollectionCollectionAndSegmentsDatabaseTenantMetadataSegmentSegmentScopeOptionalArgumentUnspecifiedUpdateMetadata)DEFAULT_DATABASEDEFAULT_TENANT	Componentc                      \ rS rSrSr\\4S\S\S\SS4S jj5       r	\\4S\S\S\
4S	 jj5       r\\4S\S\SS4S
 jj5       r\SS\4S\\   S\\   S\S\\
   4S jj5       r\S\SS4S j5       r\S\S\4S j5       r\S\SS4S j5       r\S\S\SS4S j5       r\   S)S\S\\   S\\   S\\   S\\   4
S jj5       r\\" 5       4S\S\S\\\      SS4S jj5       r\SSS\\4S\S\S\\   S\S\\   S\\    S\\   S\!S\S\S\"\#\!4   4S  jj5       r$\\\4S\S\S\SS4S! jj5       r%\SS\\SS4S\\   S\\   S\S\S\\   S\\   S\\#   4S" jj5       r&\\S4S\S\\   S\4S# jj5       r'\S$\S\(4S% j5       r)\\" 5       \" 5       \" 5       \" 5       4S\S\\   S\\\      S\\\      S\\\*      SS4S& jj5       r+\S\S\4S' j5       r,S(r-g)*SysDB   z+Data interface for Chroma's System databaseidnametenantreturnNc                     g)z]Create a new database in the System database. Raises an Error if the Database
already exists.N )selfr   r   r   s       T/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/chromadb/db/system.pycreate_databaseSysDB.create_database   s     	    c                     g)zRGet a database by name and tenant. Raises an Error if the Database does not
exist.Nr    r!   r   r   s      r"   get_databaseSysDB.get_database#        	r%   c                     g)zDelete a database.Nr    r'   s      r"   delete_databaseSysDB.delete_database)        	r%   limitoffsetc                     g)z List all databases for a tenant.Nr    )r!   r/   r0   r   s       r"   list_databasesSysDB.list_databases.   s     	r%   c                     g)zrCreate a new tenant in the System database. The name must be unique.
Raises an Error if the Tenant already exists.Nr    r!   r   s     r"   create_tenantSysDB.create_tenant8   r*   r%   c                     g)zCGet a tenant by name. Raises an Error if the Tenant does not exist.Nr    r5   s     r"   
get_tenantSysDB.get_tenant>   r.   r%   segmentc                     g)zVCreate a new segment in the System database. Raises an Error if the ID
already exists.Nr    )r!   r;   s     r"   create_segmentSysDB.create_segmentE   r*   r%   
collectionc                     g)z*Delete a segment from the System database.Nr    )r!   r?   r   s      r"   delete_segmentSysDB.delete_segmentK   r.   r%   typescopec                     g)z/Find segments by id, type, scope or collection.Nr    )r!   r?   r   rC   rD   s        r"   get_segmentsSysDB.get_segmentsP        	r%   metadatac                     g)zUpdate a segment. Unspecified fields will be left unchanged. For the
metadata, keys with None values will be removed and keys not present in the
UpdateMetadata dict will be left unchanged.Nr    )r!   r?   r   rI   s       r"   update_segmentSysDB.update_segment[   s     	r%   Fschemaconfigurationsegments	dimensionget_or_createdatabasec                     g)a  Create a new collection and associated resources
in the SysDB. If get_or_create is True, the
collection will be created if one with the same name does not exist.
The metadata will be updated using the same protocol as update_collection. If get_or_create
is False and the collection already exists, an error will be raised.

Returns a tuple of the created collection and a boolean indicating whether the
collection was created or not.
Nr    )r!   r   r   rM   rN   rO   rI   rP   rQ   r   rR   s              r"   create_collectionSysDB.create_collectiong   s    . 	r%   c                     g)z}Delete a collection, all associated segments and any associate resources (log stream)
from the SysDB and the system at large.Nr    )r!   r   r   rR   s       r"   delete_collectionSysDB.delete_collection   rH   r%   c                     g)z_Find collections by id or name. If name is provided, tenant and database must also be provided.Nr    )r!   r   r   r   rR   r/   r0   s          r"   get_collectionsSysDB.get_collections   s     	r%   c                     g)zFGets the number of collections for the (tenant, database) combination.Nr    )r!   r   rR   s      r"   count_collectionsSysDB.count_collections        	r%   collection_idc                     g)zGet a consistent snapshot of a collection by id. This will return a collection with segment
information that matches the collection version and log position.
Nr    )r!   r`   s     r"   get_collection_with_segments"SysDB.get_collection_with_segments   r_   r%   c                     g)zUpdate a collection. Unspecified fields will be left unchanged. For metadata,
keys with None values will be removed and keys not present in the UpdateMetadata
dict will be left unchanged.Nr    )r!   r   r   rP   rI   rN   s         r"   update_collectionSysDB.update_collection   s     	r%   c                     g)z.Returns the number of records in a collection.Nr    )r!   r   s     r"   get_collection_sizeSysDB.get_collection_size   r.   r%   r    )NNN).__name__
__module____qualname____firstlineno____doc__r   r   r   strr#   r   r(   r,   r   intr   r2   r6   r   r9   r   r=   rA   r   rF   r   r   r   rK   r   r
   r   r   boolr   r   rT   rW   rZ   r]   r   rb   r	   re   rh   __static_attributes__r    r%   r"   r   r      s   51?!+.	  4B  c x  
 7E C  $     $ $$	}  	
 
(	  # $  
 s v   g $  
  4 D    ""(, TN sm	
 % 
'	  
 @K}			 	 #8N#;<		
 
	 	  (,#'#$(   	
 5 7# 8$ C=    
z4	  0  %(	  	
 
   ""$(# $
TN
 sm
 	

 
 }
 
 
*	
 
  %"& 3- 
	  !	   '2m5@]?J} M s# $HSM2	
 #8N#;< (23
 
  d s  r%   r   N)abcr   typingr   r   r   uuidr   %chromadb.api.collection_configurationr   r	   chromadb.api.typesr
   chromadb.typesr   r   r   r   r   r   r   r   r   r   chromadb.configr   r   r   r   r    r%   r"   <module>rz      sA     , ,  &   H GeI er%   