Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support context-aware tablenames #614

Merged
merged 5 commits into from Jan 18, 2021
Merged

Commits on Jan 4, 2021

  1. feat: support context-aware tablenames

    This patch adds a feature which enables pop to pass down the connection context to the model's `TableName()` function by implementing `TableName(ctx context.Context) string`. The context can be used to dynamically generate tablenames which can be important for prefixed or generic tables and other use cases.
    
    Signed-off-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
    aeneasr committed Jan 4, 2021
    Copy the full SHA
    5d69084 View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2021

  1. fix: remove ineffective and bug-ridden model tableMap cache

    This patch removes the Model's `tableMap`. The cache seems to have served a purpose before `TableName()` was introduced. Now however, it does not significantly reduce computation time and instead introduces a myriad of really difficult to debug problems. This usually happens due to cacheKey collisions. The amount of time the TCP connection will use to query the database is significantly more than calling `reflect.Elem()`, further delegitimizing the complexity of having a cache here.
    
    This patch completely removes the cache and adds failing test cases to ensure that future regressions do not resurface.
    
    Signed-off-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
    aeneasr committed Jan 8, 2021
    Copy the full SHA
    bf09b4d View commit details
    Browse the repository at this point in the history
  2. fix: respect as naming in whereID and whereNamedID

    Signed-off-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
    aeneasr committed Jan 8, 2021
    Copy the full SHA
    333700c View commit details
    Browse the repository at this point in the history
  3. fix: resolve test failures and regressions

    Signed-off-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
    aeneasr committed Jan 8, 2021
    Copy the full SHA
    84c72b7 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2021

  1. Copy the full SHA
    c727474 View commit details
    Browse the repository at this point in the history