You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To recreate, prepare a SQL query
( I know the official character to be used is double-quotes but sqlite does support square brackets as well as grave accent characters - https://www.sqlite.org/lang_keywords.html - so I've included some here )
Query:
string query = @"
SELECT
""AColumn""
FROM
[ATable]
";
And an object to output result as:
public class ATable
{
public string AColumn { get; set; }
}
Run query via SQLite.Net (not sure if this issue is specific to -PCL only):
var command = connection.CreateCommand(query);
var results = command.ExecuteQuery();
Expected:
Each result in results has a populated AColumn property.
Actual:
All AColumn properties have a null value.
Reason:
SQLite.Net.SQLiteCommand.ExecuteDeferredQuery(TableMapping map) method makes a call to _sqlitePlatform.SQLiteApi.ColumnName16() to get the column names returned by the Query. The column names returned by this call INCLUDE the escape characters used when defining the column. When this column name is passed to map.FindColumn() the mapping fails as the property name on the object does not include the escape characters.