Skip to content
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Treat equivalent role-membership statements written as `EXEC sp_addrolemember ...` or `ALTER ROLE ... ADD MEMBER ...` as compatible during comparison.
- Treat legacy Service Broker message-type validation synonyms and equivalent contract/service body formatting and item ordering as compatible during comparison.
- Treat equivalent `TableData` scripts as compatible during comparison when the normalized `INSERT` statements differ only by row ordering within the same contiguous data block.
- Treat equivalent `TableData` scripts as compatible during comparison when single-row `INSERT` column lists and corresponding value tuples are reordered consistently.
- Treat equivalent `Table` scripts as compatible during comparison when post-create statement packages differ only by ordering after the base `CREATE TABLE` block.
- Treat equivalent legacy `Table` statement formatting as compatible during comparison when normalized table definitions, post-create table statements, and persisted option values are otherwise identical.
- Treat equivalent legacy `UserDefinedType` `CREATE TYPE` formatting as compatible during comparison when the normalized type definition is otherwise identical.
- Treat omitted `TEXTIMAGE_ON` on `Table` scripts as compatible during comparison only when DB metadata shows the table LOB data space matches the current default data space.
- Treat equivalent extended-property blocks as compatible during comparison when the normalized `sp_addextendedproperty` statements differ only by ordering, argument spacing, or named-vs-positional argument forms within the same contiguous block.
- Treat equivalent extended-property blocks as compatible during comparison when the normalized `sp_addextendedproperty` statements differ only by ordering, argument spacing, named-vs-positional forms, or top-level `N'...'` string literal prefixes.
- Treat leading SSMS-generated banner comments on programmable objects as compatible during comparison.
- Treat redundant empty or otherwise no-op `GO` batches as compatible during comparison.
- Treat an omitted terminal `GO` after the final batch as compatible during comparison with an explicit final `GO`.
- Keep `diff` output readable by rendering compatible `Table` and `UserDefinedType` changes from readable script text instead of opaque comparison-normalized text.
- Keep normal `diff` output readable for non-table objects such as users and roles by rendering permission changes from readable script text instead of lowercase comparison-normalized tokens.
- Keep readable `diff` output for `Table` and table-valued `UserDefinedType` bodies at per-entry granularity instead of collapsing the entire body into one changed line.
- Align readable `Table` and table-valued `UserDefinedType` diffs by individual body entries so a single changed column or inline constraint does not mark the entire body as changed.
- Exclude SSMS database-diagram support stored procedures from discovery and scripting even when SQL Server does not mark them as system-shipped.
- Exclude SSMS database-diagram support table and function objects from discovery and scripting even when SQL Server does not mark them as system-shipped.
- Script `TYPE::` permissions for scalar and table-valued `UserDefinedType` objects.
- Script database-level permissions granted directly to `Role` and `User` principals, and emit `CREATE USER ... WITHOUT LOGIN` when no server-login metadata is available.
- Treat equivalent contiguous permission statement ordering as compatible during comparison.
- Treat legacy standalone table-level inline `PRIMARY KEY` and `UNIQUE` constraints as compatible during comparison with canonical post-create key-constraint statements.
- Treat legacy CLR table-valued function return-column collation clauses as compatible during comparison when SQL Server ignores them in the effective return shape.
- Treat legacy explicit `NULL` tokens on CLR table-valued function return columns as compatible during comparison and preserve them during compatibility reconciliation when the rest of the definition matches.
- Treat equivalent legacy `Assembly` scripts as compatible during comparison when they differ only by banner comments, wrapped or case-varied hex payload formatting, `PERMISSION_SET` spacing, or quoted versus bracketed `ADD FILE` names.
- Rewrite programmable-object declaration lines to the current metadata name when SQL Server stores stale module text after an object rename.
- Fix table-trigger scripting after the declaration rewrite change by resolving trigger schema without referencing a non-existent `sys.triggers.schema_id` column.
- Trailing semicolon differences on `INSERT` statement lines in data scripts are now suppressed during comparison normalization; scripts emitted with and without statement terminators compare as compatible (#47).
- Legacy `TableData` scripts now compare as compatible when they differ from canonical output only by `SET IDENTITY_INSERT` semicolons or top-level `N'...'` string literal prefixes, including inside multi-line `INSERT ... VALUES (...)` statements.
- Whitespace-only separator lines now compare as compatible with empty blank lines during `status` and `diff`.
- Empty separator lines are now ignored during `status` and `diff`, and whitespace-only separator lines compare as compatible after normalization.
- Preserve reference banner-comment formatting and module-declaration identifier quoting during programmable-object compatibility reconciliation.
- Preserve compatible computed-column arithmetic grouping parentheses during table compatibility reconciliation.

Expand All @@ -31,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Discover and script SQL CLR scalar functions as `Function` objects.
- Discover and script SQL CLR table-valued functions as `Function` objects.
- Discover and script SQL CLR stored procedures as `StoredProcedure` objects.
- Discover and script SQL CLR aggregates as `Aggregate` objects in `Functions/`.
- Discover and script built-in `dbo` as a `Schema` object when it has explicit schema permissions or schema-level extended properties, without emitting `CREATE SCHEMA`.
- `sqlct init` now prompts interactively for connection details (server, database, auth, credentials, trust-server-certificate) when run without flags in a new project directory (#36).
- Connection flags (`--server`, `--database`, `--auth`, `--user`, `--password`, `--trust-server-certificate`) for non-interactive/scripted `init` use (#36).
Expand All @@ -39,11 +60,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Next-steps suggestions are printed after `sqlct init` to guide users toward `pull`, `status`, and `diff` (#36).
- Add `--object <selector>` to `sqlct pull` for exact-match filtering using the same selector forms as `diff --object` (#35).
- Add `--filter <pattern>` to `sqlct pull` for regex-based filtering; multiple patterns may be provided and matching is case-insensitive (#35).
- Add `--normalized-diff` to `sqlct diff` to render comparison-normalized diff text for debugging while preserving readable diff output by default.
- Add `--filter <pattern>` to `sqlct diff` for regex-based filtering; without `--object` filters the output to matching objects, with `--object` additionally constrains the single-object result (#35).
- SQL Authentication support: set `database.auth` to `"sql"` and supply `database.user` (and optionally `database.password`) in `sqlct.config.json` to connect using SQL Server Authentication (#30).
- Support active object type `Assembly`, with deterministic scripting to `Assemblies/*.sql` for user-defined SQL Server assemblies.
- Support additional active object types: `TableType`, `XmlSchemaCollection`, `MessageType`, `Contract`, `Queue`, `Service`, `Route`, `EventNotification`, `ServiceBinding`, `FullTextCatalog`, `FullTextStoplist`, and `SearchPropertyList`.
- Script standalone user-created table statistics as deterministic post-create table statements, including filtered, effective sampling, persisted-sample, incremental, and auto-drop metadata when available.
- Script persisted key and index storage options such as fill factor, pad index, duplicate-key handling, and row/page locking when those options differ from defaults.
- Add `--object <pattern>` to `sqlct data track` and `sqlct data untrack` as a flag alias for the positional pattern argument.
- Add `--filter <regex>` to `sqlct data track` and `sqlct data untrack` for regex-based table matching; matched case-insensitively against the full `schema.table` display name. Exactly one of the positional pattern, `--object`, or `--filter` must be provided; combining any two returns exit code 2.
- `sqlct diff` now uses a chunked diff format: only changed segments and configurable surrounding context lines are shown instead of the full file. Use `--context <N>` to control the number of context lines (default: 3) (#39).
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ validate configuration, and generate reproducible scripts for Git and CI/CD.
- `sqlct data untrack [<pattern>] [--object <pattern>] [--filter <regex>] [--project-dir <path>]`
- `sqlct data list [--project-dir <path>]`
- `sqlct status [--project-dir <path>] [--target <db|folder>]`
- `sqlct diff [--project-dir <path>] [--target <db|folder>] [--object <selector>] [--filter <pattern>...] [--context <N>]`
- `sqlct diff [--project-dir <path>] [--target <db|folder>] [--object <selector>] [--filter <pattern>...] [--context <N>] [--normalized-diff]`
- `sqlct pull [--project-dir <path>] [--object <selector>] [--filter <pattern>...]`

Current runtime scope for `status`, `diff`, and `pull` covers:
Expand All @@ -32,6 +32,7 @@ Current runtime scope for `status`, `diff`, and `pull` covers:
- `View`
- `StoredProcedure`
- `Function`
- `Aggregate`
- `Sequence`
- `Schema`
- `Role`
Expand All @@ -56,10 +57,14 @@ Schema scripting covers user-defined schemas and also emits built-in `dbo` when

Stored procedure scripting covers T-SQL procedures and SQL CLR stored procedures (`sys.objects.type = 'P'` and `PC`).

Role and user scripting includes database-level permissions granted directly to those principals, and loginless users are scripted as `CREATE USER ... WITHOUT LOGIN`.

Table scripting also includes standalone user-created table statistics (`CREATE STATISTICS`) as post-create table statements. Current statistics option coverage includes effective sampling (`FULLSCAN` or `SAMPLE <n> PERCENT`), `PERSIST_SAMPLE_PERCENT = ON`, `NORECOMPUTE`, `INCREMENTAL=ON`, and `AUTO_DROP = ON|OFF` when the source server exposes the required metadata. `MAXDOP`, `STATS_STREAM`, `ROWCOUNT`, and `PAGECOUNT` remain deferred.

Function scripting covers T-SQL scalar/table functions and SQL CLR scalar/table-valued functions (`sys.objects.type = 'FS'` and `FT`), including `EXTERNAL NAME` assembly bindings.

Aggregate scripting covers SQL CLR aggregates (`sys.objects.type = 'AF'`), including `CREATE AGGREGATE ... RETURNS ... EXTERNAL NAME` bindings.

When `data.trackedTables` is configured, `status`, `diff`, and `pull` also process `TableData` artifacts for those explicit tracked tables.

`--object` selectors support:
Expand Down
Loading
Loading