Skip to content

Conversation

@icanhasjonas
Copy link

@icanhasjonas icanhasjonas commented May 11, 2025

Based on the suggestion from issue #267

Currently, the API uses a TableNamePrefix string to modify table names. This works, but is inflexible.

This PR introduces an ITableNameFormatter interface to handle table name resolution.
This allows for:

  • Custom naming strategies (e.g., environment-based, hashing, localization)
  • Cleaner separation of concerns
  • Easier testing and mocking

Migration Path:

  • Mark TableNamePrefix as [Obsolete]
  • If TableNamePrefix is set, internally create a PrefixTableNameFormatter to maintain compatibility

This preserves backward compatibility while enabling greater extensibility.

Benchmark and Heap Alloc should have no- to minimal- effect. Size of passed argument (string? or ITableNameFormatter?) is the same. The formatter allows for non-heap formatting of table names (except for the simple formatter, which is more or less included for testing purposes)

@firenero firenero self-assigned this Jun 7, 2025
@firenero firenero added the enhancement New feature or request label Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants