You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Several moderate active issues remain in schema-qualified metadata lookups, concurrency guarding, and PostgreSQL identifier handling, risking incorrect or missing descriptions and duplicate expensive reads.
This PR improves offline ContextSchemaPath support by separating schema metadata, descriptions, and sampled individuals into adjacent files, while adding provider-specific bulk description loading and new full-schema design-time commands.
Changes:
Stores individuals and table/column descriptions in separate JSON files with backward-compatible loading and merge support.
Adds lazy offline loading for descriptions and individuals, plus commands for saving the full schema or sampled rows.
Adds bulk column-description queries for PostgreSQL, Oracle, MySQL, SQL Server, Firebird, and DuckDB, with accompanying tests and documentation.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Active moderate issues remain in description merging, primary-key type preservation, and quoted table-name handling across several providers, so the changes are not yet ready for approval.
No open issues 🎉
6 previously missed issues
In code that hasn't changed since last review
Preserve updated descriptions when merging existing file entries
SaveDescriptions first calls LoadDescriptions, and LoadDescriptions uses TryAdd for every entry from the existing file. Therefore an existing description wins over the value currently held in this, so saving an updated online comment silently restores the stale on-disk value. The added test saving the descriptions read so far keeps the others in the file expects "Changed" here and will fail; merge the old file only for keys that are absent from the current cache, while letting the current cache overwrite matching keys.
The conversion is applied to the primary key as well as ordinary column values. For a primary key type such as DateTimeOffset, IndividualsFileValue converts the key to text; offline createIndividualsType then embeds that string in GetIndividual, which binds it using the database's original primary-key mapping and can fail or select no row. Only non-key display values can safely be downgraded to text; preserve the key's type or restore it from the cached column mapping when loading.
Unquote table and schema names before SQL Server metadata lookup
This dynamic SQL Server implementation has the same identifier issue as the regular provider: Table.FullName wraps whitespace-containing names in double quotes, but those wrappers are bound directly to sys.tables.name/sys.schemas.name. The new full-schema description export will silently miss tables such as Order Details; strip the wrapper quotes from both parsed names before binding them.
Unquote table and schema names before SQL Server metadata lookup
Table.FullName also quotes names containing spaces, so tn/sn can contain the literal " wrapper. Comparing those values to sys.tables.name and sys.schemas.name makes descriptions for tables such as Order Details return no rows, including in the new all-columns query. Remove the wrapper quotes before binding the metadata names.
Unquote Oracle identifiers before querying description metadata
src/SQLProvider.Runtime/Providers.Oracle.fs:232
Table.FullName adds double-quote wrappers around identifiers containing spaces, but descriptionOwnerAndTable only escapes apostrophes and leaves those wrappers in the values compared with ALL_TAB_COMMENTS/ALL_COL_COMMENTS. An Oracle table such as Order Details therefore has no matching description in the new offline export. Strip the wrapper quotes before applying sqlText (the escaping should happen after unquoting).
Unquote PostgreSQL identifiers before regclass lookup
Table.FullName wraps identifiers containing spaces in double quotes, but this path passes those wrappers to PostgreSQL's %I formatter. For a table such as Order Details, tn is already "Order Details", so %I quotes the quote characters and the regclass lookup misses the real table; SaveContextSchemaFull consequently omits its descriptions. Strip the provider-added quote wrappers before passing schema/table names (as the MySQL and DuckDB implementations do).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Offline mode (ContextSchemaPath) improvements: Individuals to a separate json file, and add schema descriptions to another one.