Skip to content

SQLiteConnection.Query does not work with ValueTuples #1007

Description

@XavierAP

Would be really nice if it did, when using "manual SQL" instead of ORM, because in that case declaring the classes is unnecessary overhead. For example from the README:

public class Val
{
	public decimal Money { get; set; }
	public DateTime Date { get; set; }
}
public static IEnumerable<Val> QueryVals(SQLiteConnection db, long stockId) {
	return db.Query<Val>("select Money, Date from Valuation where StockId = {stockId}");
}

The following variation does not work. It runs, but the returned List is just full of default values (although the correct number of records).

db.Query<(decimal Money, DateTime Date)>("select Money, Date from Valuation where StockId = {stockId}")

The cause seems to be that sqlite-net needs columns to map to properties, not fields.

Would there be any interest in this enhancement?

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