Skip to content

Multi database#341

Closed
Christian-B wants to merge 15 commits into
masterfrom
multi_database
Closed

Multi database#341
Christian-B wants to merge 15 commits into
masterfrom
multi_database

Conversation

@Christian-B

Copy link
Copy Markdown
Member

Allows for multiple logs databases.
replaces #340

LogSqlLiteDatabase track the keys they work for

  • 1 database can cover multiple keys
  • Database with the same key can not be registered in the same python run
  • remove the ability/ responsibility to clear
  • read only by default
  • need file path passed in

DataView now holds the mapping between keys and paths

  • added during register_binary_search_path
  • default added on a get of the default ""

DataWriter clears the mapping of key to path on mock for easier testing

FileConvertor

  • Changed from call() style init and convert methods
  • Allows One FileConvertor object to be used multiple times
  • Takes Log Database object and key as parameters
  • adds key to beginning of log message

Convert

  • called with source, destination, key and database file
  • main adds default key and file if 2 or 3 params passed in
  • FileConveter object created and used for all files

Replacer

  • uses firs character of short as key to find correct database

cfg changed as option not used at this level

  • test configs changed to use different section

tests

  • replacer log files generated by tests
  • delete database file instead of clear
  • convert called with source, destination, key and database file
  • LogSqlLiteDatabase called with database path
  • new FileConverter style used.
  • use of os.environ["C_LOGS_DICT"] reduced and when used set by mock

Comment thread unittests/make_tools/test_file_convert.py Fixed
Comment thread unittests/make_tools/test_file_convert.py Fixed
Comment thread unittests/make_tools/test_file_convert.py Fixed
Comment thread unittests/make_tools/test_file_convert.py Fixed
Comment thread unittests/make_tools/test_file_convert.py Fixed
Comment thread unittests/make_tools/test_file_convert.py Fixed
Comment thread unittests/make_tools/test_file_convert.py Fixed
Comment thread unittests/make_tools/test_file_convert.py Fixed
@Christian-B Christian-B requested a review from rowleya December 5, 2025 07:03

@rowleya rowleya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - minor comment to fix if correct

def __init__(self) -> None:
self._data_status: DataStatus = DataStatus.NOT_SETUP
self._executable_finder: ExecutableFinder = ExecutableFinder()
self._log_database_paths: Dict[str, Optional[str]] = {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the value optional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. In this case the None represent that what was identified as the database key was invalid.

The alternatives where recheck the invalid key every time or worse have the Replacer fail on an invalid key.

@Christian-B Christian-B mentioned this pull request Dec 10, 2025
@Christian-B

Copy link
Copy Markdown
Member Author

needs changes in #343

@Christian-B Christian-B closed this Jan 5, 2026
@Christian-B Christian-B deleted the multi_database branch January 5, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants