Skip to content

Conversation

@crwells
Copy link

@crwells crwells commented Sep 4, 2025

Motivation and Context (Why the change? What's the scenario?)

Reading the SQL in these two classes is very difficult, and there is a lot of repetitive code in each method.

Example of previous SQL block:

        var queryColumns = $"{this.GetFullTableName(this._config.MemoryTableName)}.[id]," +
                           $"{this.GetFullTableName(this._config.MemoryTableName)}.[key]," +
                           $"{this.GetFullTableName(this._config.MemoryTableName)}.[payload]," +
                           $"{this.GetFullTableName(this._config.MemoryTableName)}.[tags]";

Now becomes

        var memoryTable = this.GetFullTableName(this._config.MemoryTableName);

        var queryColumns = $"{memoryTable}.[id]," +
                           $"{memoryTable}.[key]," +
                           $"{memoryTable}.[payload]," +
                           $"{memoryTable}.[tags]";

The important part of the code (generating a SQL statement) no longer gets washed out by the repetitive, unimportant code.

High level description (Approach, Design)

This changes generates the table names at the beginning of each method and then uses them in constructing the queries. This improves readability, and makes it easier to make changes in the future.

@crwells crwells requested a review from dluc as a code owner September 4, 2025 15:34
@dluc
Copy link
Collaborator

dluc commented Nov 3, 2025

Closing as part of repository maintenance - no further action planned on this issue.

@dluc dluc closed this Nov 3, 2025
@microsoft microsoft locked and limited conversation to collaborators Nov 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants