Skip to content

API problem "var row in db.Query("SELECT rowid, * FROM foo").ToArray()" #40

Description

@gentledepp

Hi!

I migrated SyncClient.SQLite from SQLitePCL to your SQLitePCL.pretty.

Honestly, I do like your api better, but there is a pretty serious gotcha:

The following code will give you an ObjectDisposedException:

// all fine here
var query in db.Query("SELECT rowid, * FROM foo");
// now, when enumerated, the inner IStatement is actually disposed
var rows = query.ToArray()
// so the following line gives you an "objectdisposedexception"
var rowId = rows[0][1].ToInt();

I tried to find out how that works underneath, but I could not find any clue.
What I do know, is that you need to dispose the internals IStatement somehow, but cant there be another way of doing it?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions