diff --git a/dcs_core/core/datasource/sql_datasource.py b/dcs_core/core/datasource/sql_datasource.py index 93a235c9..7bddc8f7 100644 --- a/dcs_core/core/datasource/sql_datasource.py +++ b/dcs_core/core/datasource/sql_datasource.py @@ -174,6 +174,19 @@ def query_get_table_metadata(self) -> List[str]: """ return inspect(self.connection.engine).get_table_names() + def query_get_database_version(self) -> str: + """ + Get the database version + :return: version number + """ + query = "SELECT @@version" + result = self.fetchone(query)[0] + + if result: + return result + + return "Unknown version" + def query_get_row_count(self, table: str, filters: str = None) -> int: """ Get the row count