File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
2+ using System . Linq ;
23using System . Linq . Expressions ;
34
45using SQLitePCL . pretty . Orm . Attributes ;
@@ -18,7 +19,9 @@ internal FromClause(string table)
1819
1920 public WhereClause < T > Select ( )
2021 {
21- return new WhereClause < T > ( this , Expression . Constant ( "*" ) , null ) ;
22+ var table = TableMapping . Create < T > ( ) ;
23+ var columns = table . Columns . Keys . Select ( col => table . TableName + "." + col ) . ToList ( ) ;
24+ return new WhereClause < T > ( this , columns , null ) ;
2225 }
2326
2427 public override string ToString ( )
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ public static partial class SqlQuery
1313 public sealed class WhereClause < T > : ISqlQuery
1414 {
1515 private readonly FromClause < T > from ;
16- private readonly Expression select ;
16+
17+ // FIXME: Long term, prefer some sort of expression syntax
18+ private readonly IReadOnlyList < String > select ;
1719 private readonly Expression where ;
1820
19- internal WhereClause ( FromClause < T > from , Expression select , Expression where )
21+ internal WhereClause ( FromClause < T > from , IReadOnlyList < String > select , Expression where )
2022 {
2123 this . from = from ;
2224 this . select = select ;
@@ -130,7 +132,7 @@ public LimitClause<T> ElementAt(int index)
130132 public override string ToString ( )
131133 {
132134 return
133- "SELECT " + select . CompileWhereExpr ( ) +
135+ "SELECT " + string . Join ( ", " , select ) +
134136 "\r \n " + from . ToString ( ) +
135137 ( where != null ? "\r \n WHERE " + where . CompileWhereExpr ( ) : "" ) ;
136138 }
You can’t perform that action at this time.
0 commit comments