0
我正在構建一個SQL接口,它將充當接口,以便能夠爲許多數據庫(包括SQLite和MySql)構建SQL查詢。在C#中構建SQL查詢生成器接口
由於查詢字符串在這兩種數據庫類型之間的語法不同,我認爲這裏的接口是最好的解決方法。
我想確保每個方法(插入,CreateTable,ReadColumn)具有所有必要的參數來建立一個工作的查詢,並提供最大的功能。
目前,這是我...
public interface IDatabase
{
bool CreateTable(SqlTable table);
bool AlterTable(SqlTable from, SqlTable to);
bool UpdateValue(string table, List<SqlValue> values, List<SqlValue> wheres);
bool InsertValues(string table, List<SqlValue> values);
bool ReadColumn(string table, List<SqlValue> wheres);
bool DeleteRow(string table, List<SqlValue> wheres);
}
任何人都可以提出任何添加/編輯我應該讓我的界面,使其更實用?
感謝 顛簸
也許考慮[動態linq](http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library。 ASPX)。如果它們不存在,您可以始終實現自己的查詢提供程序。 – 2012-01-11 08:28:05