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

Microsoft.Data.Sqlite: Incremental blob I/O #13824

Closed
bricelam opened this issue Apr 2, 2014 · 8 comments
Closed

Microsoft.Data.Sqlite: Incremental blob I/O #13824

bricelam opened this issue Apr 2, 2014 · 8 comments
Assignees
Labels
area-adonet-sqlite closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. good first issue This issue should be relatively straightforward to fix. help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-enhancement
Milestone

Comments

@bricelam
Copy link
Contributor

bricelam commented Apr 2, 2014

See Open A BLOB For Incremental I/O.

This would light up the GetBytes, GetChars & GetStream methods on SqliteDataReader.

@bricelam bricelam changed the title Enable incremental blob i/o Incremental blob I/O Apr 2, 2014
@bricelam
Copy link
Contributor Author

bricelam commented Dec 20, 2017

@buybackoff Would you be interested in contributing in this area? (Possibly just GetBytes)

@buybackoff
Copy link

I have it my fork Spreads/Spreads.SQLite@21add79

I do not use much functionality of SQL, only as ordered KV blob storage, so I am pretty much all set already.

@bricelam
Copy link
Contributor Author

I noticed you had a commit that mentioned it, but I can't/shouldn't look at it unless you submit a PR and sign the CLA. No worries if you're not interested; I just thought I'd ping you to see if you were.

@AlexanderTaeschner
Copy link
Contributor

sqlite3_blob_open is only usable to open a BLOB in a certain row in a specific column of an existing table. Since the SqliteDataReader can only get the column and table name but not the rowid, it can not be used to implement GetBytes!
From my point of view the only use case could be to access a really large BLOB incrementally. Would this be interesting?

@bricelam
Copy link
Contributor Author

bricelam commented Apr 9, 2018

Oh wow, that is restrictive. It's a lower-priority feature, but I think it's still interesting for certain applications.

We could make the APIs use sqlite3_column_blob and a MemoryStream by default. But if you happen to SELECT rowid it can use a more optimized sqlite3_blob_open codepath.

@bricelam
Copy link
Contributor Author

bricelam commented Apr 9, 2018

It's not very discoverable, but at least it unblocks applications that need to either...

  • Peek at the first few bytes/characters (e.g. file headers)
  • Do some forward-only parsing/querying/interpreting in a memory-optimized way (e.g. XML, JSON, BAML, etc.)

@bricelam
Copy link
Contributor Author

bricelam commented Apr 9, 2018

sqlite3_bind_zeroblob() is related to these scenarios. To stream a BLOB into the database, you'd INSERT using a zeroblob parameter of the correct size then call sqlite3_blob_open and sqlite3_blob_write.

@bricelam bricelam self-assigned this Apr 13, 2018
@ajcvickers ajcvickers transferred this issue from aspnet/Microsoft.Data.Sqlite Oct 31, 2018
@ajcvickers ajcvickers added this to the Backlog milestone Oct 31, 2018
@ajcvickers ajcvickers added area-adonet-sqlite help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-enhancement labels Oct 31, 2018
@ajcvickers ajcvickers changed the title Incremental blob I/O Microsoft.Data.Sqlite: Incremental blob I/O Oct 31, 2018
@bricelam bricelam modified the milestones: Backlog, 3.0.0 Nov 12, 2018
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 20, 2018
@bricelam
Copy link
Contributor Author

Initial implementation merged. See #13987 for further improvements.

@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview2 Feb 6, 2019
@bricelam bricelam added the good first issue This issue should be relatively straightforward to fix. label May 31, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview2, 3.0.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-adonet-sqlite closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. good first issue This issue should be relatively straightforward to fix. help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-enhancement
Projects
None yet
Development

No branches or pull requests

4 participants