Repository navigation
test: the EF satellite's queries, keys and round trips run on a real SQL Server - #142
Merged
Merged
Conversation
…SQL Server The query catalogue (QueryShapes) and the key catalogue (KeyShapes) run on SQL Server 2022 in a container, as do the round trips the PostgreSQL class makes. Each query over a value object is held to the same query over the wrapped type there, and then to memory: a difference from memory passes only where SQLite answers the same (a relational trait, such as a null .Value that is a NULL in SQL), where the same query through ValueOrNull() answers it, or where it is a fact of SQL Server's pinned in design/knowledge with a test of plain EF Core (KB-048 to KB-054): text compared ignoring case and trailing spaces, a uniqueidentifier ordered by its last group, decimal(18,2) by default, time under a day (refused in a column, misread from JSON), no MAX of a bit, Greatest and Least only from compatibility level 160, datetime2 reading a DateTime back as Unspecified. No difference called for a change in src/: a value object does on SQL Server what its wrapped type does. The EF README states the ones a consumer meets. The catalogue's text, char and Guid values now mix case and ascend by the Guid's first group, so a collation or a uniqueidentifier order cannot match memory by accident. That showed the SQLite test's stand-in for Greatest and Least comparing strings by the culture, where the value object's generated comparison and SQLite's max are ordinal; it compares text ordinally now. The container is a plain Testcontainers one, started by its log line, so TYPEKIT_MSSQL_IMAGE can name Azure SQL Edge, which runs natively on an arm64 Mac where 2022 does not start under QEMU. The classes that need Docker carry the trait Needs=Docker, which CI's Windows and macOS legs leave out, the PostgreSQL round trips included. SqlServerQueryVariantTests and SqlServerKeyVariantTests are oracles, caught by a new seed (a column cast instead of re-typed) and by the ushort key seed. Closes #81 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odoMetis.TypeKit into test/ef-sql-server # Conflicts: # test/oracles/claims.json
This was referenced Oct 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #81
Problem
The EF satellite's queries and round trips ran on SQLite and PostgreSQL. SQL Server, where
.Value"works in LINQ as it does in memory" is most likely to differ, was only checked for its model. No query, insert or key read-back ever reached a SQL Server, so nothing said what a consumer sees there.Change
SqlServer.cs): SQL Server 2022, one container for theSQL Servercollection, a database per class, many models in schemas of their own. It's a plain Testcontainers container started by its log line, soTYPEKIT_MSSQL_IMAGEcan name Azure SQL Edge on an arm64 Mac, where 2022 doesn't start under QEMU.SqlServerQueryVariantTests: the wholeQueryShapescatalogue (~10k cases). Each case is held to the wrapped type's query on SQL Server (rows, and SQL on a table column), as the SQLite test does through the now-sharedAnswersAsTheWrappedType. Then it is held to memory. A difference passes only where SQLite answers the same, where theValueOrNull()form answers it (null.Valuesemantics), or where it is a pinned SQL Server fact (Known).Greatest/Leastare also checked at compatibility level 160, without a server: the value object's SQL is the wrapped type's.SqlServerKeyVariantTests: everyKeyShapesshape × key kind, inserted and read back. Identity and TPC-sequence keys get the wrapped type's numbers. Assigned keys (char,Guid) round-trip.SqlServerRoundTripTests: the PostgreSQL round trips on SQL Server, plus case-insensitive and trailing-space matching and decimal rounding on value objects next to plain columns.test/CodoMetis.TypeKit.Facts):uniqueidentifierorders by its last group;decimalisdecimal(18,2)by default, read back at scale 2 and rounded on write;timeholds less than a day: refused in a column, and silently misread from a JSON column (1.02:00:00→01:02:00);MAXorMINof abit;Greatest/Leastonly from compatibility level 160;datetime2keeps every tick and readsKindback as Unspecified.src/. Every difference is the wrapped type's too, so none called for a change there. The EF README gets an On SQL Server section with the ones a consumer meets, plus seven claims (E17-*).charnow mix case (Bravo,alpha), and the Guids ascend by their first group, so a collation or Guid order can't match memory by accident. This exposed the SQLite test'sGreatest/Leaststand-in comparing strings by culture. It now compares ordinally, as the value object and SQLite do.Needs=Docker(--filter-not-trait): the PostgreSQL round trips and the SQL Server classes and facts. Linux runs them all. CONTRIBUTING says how to run them locally.Tests
docs-query checkare clean. CI's Linux leg runs SQL Server 2022, the image the facts pin.SqlServerQueryVariantTestsandSqlServerKeyVariantTestsare registered. The new seedcolumn-cast-not-re-typedis caught: 2,978 of 10,071 cases fail.ushort-key-not-generatedis caught by the key leg: 10 of 170 fail.Knownfails 141 Guid cases.🤖 Generated with Claude Code