public static IEnumerable <T> Query <T>(this MappedTable <T> table, string sqlWhereClause) { string sqlQuery = "SELECT * FROM " + SQLiteMapperHelpers.GetEscaped(table.TableName) + " " + sqlWhereClause; return(table.Context.Mapper.Query <T>(sqlQuery)); }
public override string ToString() { StringBuilder builder = new StringBuilder(); builder.AppendFormat("IndexName=\"{0}\", ", IndexName ?? ""); builder.Append("Columns = ( "); builder.Append( string.Join(", ", ColumnDefinitions.Select(x => SQLiteMapperHelpers.GetEscaped(x ?? "")) ) ); builder.AppendFormat(" ), Unique = {0}", Unique); return(builder.ToString()); }
public long GetCount(string tableName, string whereClause = "") { return(QueryScalar <long>("SELECT COUNT(*) FROM " + SQLiteMapperHelpers.GetEscaped(tableName) + " " + whereClause)); }