Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison Macros #17

Merged
merged 6 commits into from
Aug 31, 2023
Merged

Comparison Macros #17

merged 6 commits into from
Aug 31, 2023

Conversation

zadykian
Copy link
Contributor

@zadykian zadykian commented Aug 30, 2023

Improved mechanism of values comparison in built-in macros: isEqual, isNotEqual, isLessEqual, isLessThan, isGreaterEqual, isGreaterThan

For instance, previous implementation fails to handle following construct:

#isGreaterThan<DayOfMonth, 1900-01-02, sql {  ,[DayOfMonth]}>
System.InvalidCastException: 'Invalid cast from 'DateTime' to 'Double'.'

See unit tests for more cases

@sdcb sdcb merged commit de91daa into sdcb:master Aug 31, 2023
@zadykian
Copy link
Contributor Author

@sdcb, could you also publish sdmap.ext and sdmap.ext.Dapper 0.16.5 to Nuget? Since these two packages depend on base sdmap

@sdcb
Copy link
Owner

sdcb commented Sep 1, 2023

I think it will work if install both sdmap.ext.Dapper and sdmap, in theory publish sdmap.ext and sdmap.ext.Dapper isn't necessary, but yes I can publish.

@sdcb
Copy link
Owner

sdcb commented Sep 1, 2023

And 1900-01-01 won't work, I think you must use "1900-01-01"(with quotes), can reference following code:

var c = new SdmapCompiler();
c.AddSourceCode("""
sql v1{#isGreaterThan<DayOfMonth, "2023/9/1", sql {  ,[DayOfMonth]}>}
""");
c.Emit("v1", new {DayOfMonth=DateTime.Now}).Dump();
// result:   ,[DayOfMonth]

@zadykian zadykian deleted the fix/comparison-macros branch October 27, 2023 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants