-
Notifications
You must be signed in to change notification settings - Fork 819
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from glenebob/native-backend-convert-2
Big rewrite and optimization of code which converts data from Npgsql to Postgresql. Native to backend conversion code. Fixed BasicNativeToBackendTypeConverter.ToBinary() (broken in commit d2b636a): Reverted back to the correct "\" when escaping byte values. Added class BackendToNativeTypeConverterOptions to describe UseConformantStrings, Supports_E_StringPrefix and SupportsHexByteFormat. Maintain one on each connector for use during encoding. Push E string prefix and escaping logic down the conversion stack so that array elements can use the same logic. Only escape \ if the backend is expecting non conformant strings. Implement string escapes in a function rather than using multiple string.Replace() calls. Do all bytea string escaping in ToBinary(), and then do not escape its output again. Encode bytea data in the new hex format when possible (>= 9.0), which cuts some such strings in half. Don't use the E prefix if the backend doesn't understand it. Assume non conformant strings on all version 2 connections, since we can't track changes to the setting. The E prefix causes this to work if the backend is expecting conformant strings. Expose UseConformantStrings, Supports_E_StringPrefix and SupportsHexByteFormat via NpgsqlConnection.
- Loading branch information
Showing
7 changed files
with
640 additions
and
559 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.