I am working on building a SQL Interface which will act as an Interface to be able to build SQL Queries for many databases, including SQLite and MySql.
As the query string Syntax differs between these two database types, I think an interface would be the best workaround here.
I want to make sure that each method (Insert, CreateTable, ReadColumn) has all the necessary arguments to build up a working query that works, and gives maximum functionality.
Currently this is what I have…
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);
}
Can anyone suggest any additions/edits I should make to my interface to make it more functional?
Thanks
Twitchy
What about
ORDER,GROUP BY,HAVING,TOP(SQL-Server),LIMIT(MySQL) etc.? I don’t think this can easily be represented by an interface, unless you restrict yourself to a common subset of SQL.