Implement retrieval of repo name
This commit is contained in:
		
							parent
							
								
									28c51e5154
								
							
						
					
					
						commit
						e512fb1e23
					
				|  | @ -47,6 +47,9 @@ class BorgDatabase(object): | |||
|     def get_repos(self): | ||||
|         return self.repo_conn.get_all() | ||||
| 
 | ||||
|     def get_repo_name(self, repo): | ||||
|         return self.label_conn.get_repo_name(repo.primary_key) | ||||
| 
 | ||||
|     def get_cache(self, repo): | ||||
|         archive = Archive.from_sql(self.get_latest_archive(repo)) | ||||
|         return self.cache_conn.get(archive.primary_key) | ||||
|  |  | |||
|  | @ -56,3 +56,15 @@ class LabelConn(DatabaseConnection): | |||
|         self.sql_commit() | ||||
| 
 | ||||
|     # endregion | ||||
| 
 | ||||
|     # region QUERIES | ||||
| 
 | ||||
|     def get_repo_name(self, repo_id): | ||||
|         result = self.sql_execute_one(f"SELECT label FROM {self._sql_table} WHERE repo_id = ?", | ||||
|                                       (repo_id,)) | ||||
|         if result is None: | ||||
|             return None | ||||
|         else: | ||||
|             return result[0] | ||||
| 
 | ||||
|     # endregion | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user