Skip to content

SQLiteAsyncConnection.QueryAsync not returning data from columns #557

Open
@jeromesadler

Description

@jeromesadler

Hi,

I am using SQLite-net-PCL v.1.3.3 in a Xamarin Forms UWP project, and cannot understand this behaviour; don't know if it's a bug or something I haven't understood. I think I should be able to query columns from a table (FnImage, in the example below), and populate a collection of local objects (Test, below), with each instance in that collection of Test objects having the column values from a row in the FnImage table. I do not want to just create a local collection of rows from the FnImage table for memory management reasons; my result set should just include the data in the columns I am querying.

Task.Run(async () =>
{
var v = await mySQLiteAsyncConnection.QueryAsync< Test >("select 'Name', 'DbBytesThumbnail' from FnImage where 'Id' > ? ", 0);
...
}
public class Test {
public byte[] DbBytesThumbnail { get; set; }
public string Name { get; set; }
}
The code does create a collection with a single instance of Test in it (there should be more, given the data in the FnImage table), and both properties in that single instance are null. I've tried mapping 'select 'Name' as Name, 'DbBytesThumbnail' as DbBytesThumbnail..., changing the name of the properties in the local Test object and the "as" clause in the query, changing bits of syntax in the query (";" at the end, with and without single quotes, etc...) and spent hours on this with no success. The FnImage table exists, I am using it elsewhere with no problems (with the myAsyncConnection.Table() query syntax). The task does not enter a Faulted state / no exception is thrown. Is this an issue with SQLite-net-PCL, or what I am doing with it? 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions