Conversation
S7 registers methods for generics from other packages, base's print() and format() included, only when methods_register() runs at load time. Without it the installed package ignored its print() method for sqlr_sql.
Neither dialect has a method for it: each reads types inside its sqlr_reflect_schema() method, which is where the reverse mapping lives.
The lookup table mixed spellings from several engines and would have grown with every dialect, while an unknown name quietly became sqlr_other(), so a typo or a bare float could never compare equal to its reflection. Anything outside the standard set is now an error, and format() runs the table in reverse, which sqlr_diff() now prints.
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
floatincluded, is an error pointing to?as_sqlr_typeandsqlr_other(), instead of a silentsqlr_other().with time zone, readbinary(n)as variable-length and leftcharunsized. A parsed type now equals what its constructor builds, withrawleft for reflection to set, as?sqlr_typedocuments.format()method that runs the same table in reverse and falls back to the constructor call, such assqlr_integer_type(bytes = 1L). A type difference insqlr_diff()now readsvarchar(255) vs text, and equality compares constructor calls, replacingtype_key().S7::methods_register()in.onLoad(). Without it an installed sqlr never registers S7 methods on base generics, soformat()would only have worked underload_all(), and the existingprint()method forsqlr_sqlhas been ignored all along. The format tests guard this underR CMD check, which runs them against the installed package.sqlr_parse_type(), so it is dropped, along with theutilsimport only the old parser used. Neither dialect has calledas_sqlr_type()since Reflect column types with this dialect's own mapping sqlr.sqlite#2, so the stricter parsing reaches authored strings only.Spellings that parsed before and are now refused:
int2,int4,int8smallint,integer,bigintfloat4,float8,double, barefloatreal,double precisionorfloat(p)bpcharchar(n)byteablobboolbooleantimetz,timestamptztime with time zone,timestamp with time zonejsonbsqlr_json(binary = TRUE)varcharwithout a lengthvarchar(n), ortextif unboundedgeometrysqlr_other("geometry")Fixes #9