Skip to content

Conversation

@koenvo
Copy link
Contributor

@koenvo koenvo commented Dec 10, 2025

Implement configurable table prefix to allow prefixing all database tables.
This enables multiple environments (dev, staging, prod) to share the same
database or better organize tables.

Configuration example:

  main:
    metadata_url: "sqlite:///database.db"
    metadata_options:
      table_prefix: "prod_"

Changes:

  • Add get_tables(table_prefix) factory function in tables.py
  • Update SqlAlchemySessionProvider to accept and use table_prefix
  • Update SqlAlchemyDatasetRepository to access tables via properties
  • Add metadata_options config support in main.py
  • Add end-to-end test for table prefix functionality

All table names and foreign key references are properly prefixed.
Fully backward compatible - existing configs work without changes.

Implement configurable table prefix to allow prefixing all database tables.
This enables multiple environments (dev, staging, prod) to share the same
database or better organize tables.

Configuration example:
  main:
    metadata_url: "sqlite:///database.db"
    metadata_options:
      table_prefix: "prod_"

Changes:
- Add get_tables(table_prefix) factory function in tables.py
- Update SqlAlchemySessionProvider to accept and use table_prefix
- Update SqlAlchemyDatasetRepository to access tables via properties
- Add metadata_options config support in main.py
- Add end-to-end test for table prefix functionality

All table names and foreign key references are properly prefixed.
Fully backward compatible - existing configs work without changes.
@koenvo koenvo changed the title Feat/database prefix Add table prefix support for SQLAlchemy dataset store Dec 10, 2025
@koenvo koenvo merged commit 69c74e3 into main Dec 11, 2025
8 checks passed
@koenvo koenvo deleted the feat/database-prefix branch December 11, 2025 09:04
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.

2 participants