-
-
Notifications
You must be signed in to change notification settings - Fork 198
/
ISqlBuilder.cs
48 lines (47 loc) · 1.75 KB
/
ISqlBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System.Collections.Generic;
namespace YesSql
{
/// <summary>
/// A class implementing this interface is able to create custom SQL queries.
/// </summary>
public interface ISqlBuilder
{
string Clause { get; }
Dictionary<string, object> Parameters { get; }
string FormatColumn(string table, string column, string schema, bool isAlias = false);
string FormatTable(string table, string schema);
string GetSelector();
void InnerJoin(string table, string onTable, string onColumn, string toTable, string toColumn, string schema, string alias = null, string toAlias = null);
bool HasJoin { get; }
bool HasOrder { get; }
void ClearGroupBy();
void ClearOrder();
void OrderBy(string orderBy);
void OrderByDescending(string orderBy);
void OrderByRandom();
void Select();
void Selector(string selector);
void Selector(string table, string column, string schema);
void AddSelector(string select);
void InsertSelector(string select);
void Distinct();
bool HasPaging { get; }
void Skip(string skip);
void Take(string take);
void Table(string table, string alias, string schema);
void From(string from);
void ThenOrderBy(string orderBy);
void ThenOrderByDescending(string orderBy);
void ThenOrderByRandom();
void Having(string having);
void GroupBy(string groupBy);
void Trail(string trail);
void ClearTrail();
string ToSqlString();
void WhereAnd(string clause);
void WhereOr(string clause);
ISqlBuilder Clone();
IEnumerable<string> GetSelectors();
IEnumerable<string> GetOrders();
}
}