Conversation
The dialects list the types their round-trip tests cover by hand, so a type nobody listed goes unexercised. Core now ships the list and a helper that runs each entry against a live connection, skipping what a dialect declares it cannot represent. Table names carry the process id so concurrent runs against a shared server do not collide.
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.
Summary
sqlr_conformance_types(), one entry per type class and per value of each parameter it carries, and a core test fails when the IR gains a class or parameter the list does not cover.sqlr_test_types()with a function that opens a connection. Each entry becomes its own test, which renders a one-column table, creates it, reflects it and fails with thesqlr_diff()lines unless nothing changed. Types the dialect cannot represent are declared inskipwith a reason and skipped citing it; an unknown name is an error.tinyintpasses since Reflect column types with this dialect's own mapping sqlr.sqlite#2) and 6 on Postgres, wheretinyintdoes not render,integer_unsignedreads back asinteger,numeric_precisionwith scale 0,char_unsizedaschar(1), andvarbinaryandbinaryas an unboundedbytea. Both dialects adopt the helper in their own PRs once this is on main, since they install sqlr from there.Fixes #10