Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Add BinaryGUID connection string to select binary/string GUID storage #363

Closed
wants to merge 1 commit into from
Closed

Add BinaryGUID connection string to select binary/string GUID storage #363

wants to merge 1 commit into from

Conversation

AlexanderTaeschner
Copy link
Contributor

Addresses #273.

To be able to access the new BinaryGUID property in ConnectionStringBuilder from the parameter binding I added a wrapper around the sqlite3_stmt object and add the associated connection to it.

@bricelam
Copy link
Contributor

This will greatly complicate any framework that generates SQL literals (including EFCore). I want to re-discuss with the team whether we should ever implement this feature.

@AlexanderTaeschner
Copy link
Contributor Author

Please keep in mind, that this only affects the way an GUID parameter is bind. Since #191 is resolved, the library can read both binary and string GUID without being told how the data is stored (thanks to the dynamic type system of sqlite).

@bricelam
Copy link
Contributor

bricelam commented Apr 28, 2017

Understood. Our philosophy so far has been to be highly compatible on reads, but highly predictable on writes. We support many formats when reading DateTime, DateTimeOffset, Guid, and TimeSpan values, but we'll always write using a canonical format.

Currently, EF Core generates queries like the following.

SELECT $someGuidParam = x'SOME_BLOB_VALUE';
-- or
SELECT * FROM MyTable
WHERE SomeGuidColumn = x'SOME_BLOB_VALUE';

After this, they'd return zero/empty, and we (EF Core and other libraries using this) would need to change the format of Guid literals based on the connection string.

@AlexanderTaeschner
Copy link
Contributor Author

Ah okay, now I understand the problem.

@bricelam
Copy link
Contributor

bricelam commented May 1, 2017

Closing. We decided against taking this feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants