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

Updates to value converter docs #3020

Merged
merged 3 commits into from
Jan 19, 2021
Merged

Updates to value converter docs #3020

merged 3 commits into from
Jan 19, 2021

Conversation

ajcvickers
Copy link
Contributor

Lots of examples!

Fixes #614
Fixes #784
Part of #685
Fixes #2252
Fixes #2415
Fixes #2456
Fixes #2824
Fixes #2979

@ajcvickers ajcvickers requested a review from a team January 17, 2021 16:44
Lots of examples!

Fixes #614
Fixes #784
Part of #685
Fixes #2252
Fixes #2415
Fixes #2456
Fixes #2824
Fixes #2979
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, love the examples.


### Handle fixed-length database strings

The previous example did not need a value converter. However, a converter can be useful for fixed-length database string types like `char(20)` or `nchar(20)`. Fixed-length strings are padded to their full length whenever a value is inserted into the database. This means that a key value of "dotnet" will be read back from the database as "dotnet ". This will then not compare correctly with key values that are not padded.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The previous example did not need a value converter. However, a converter can be useful for fixed-length database string types like `char(20)` or `nchar(20)`. Fixed-length strings are padded to their full length whenever a value is inserted into the database. This means that a key value of "dotnet" will be read back from the database as "dotnet ". This will then not compare correctly with key values that are not padded.
The previous example did not need a value converter. However, a converter can be useful for fixed-length database string types like `char(20)` or `nchar(20)`. Fixed-length strings are padded to their full length whenever a value is inserted into the database. This means that a key value of `dotnet` will be read back from the database as `dotnet `. This will then not compare correctly with key values that are not padded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are fences really appropriate here? These are actually string values, not, not language concepts or typpes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, but (a) the spaces don't really show, and (b) "dotnet" may get machine-translated (to who knows what)...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out we are not allowed trailing spaces in fences, so leaving as is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment