// DELETE - MASTER public static string Delete(string table, string where = "", int limit = 0) { _SQLQuery = new SQLQueryItem(); _SQLQuery.Type = SQLQueryItem.TypeEnum.DELETE; _SQLQuery.Table = table; if (!String.IsNullOrEmpty (where)) _SQLQuery.SetFilter (where); if (limit != 0) _SQLQuery.Limit = limit; return _SQLQuery.build(); }
public static string Update(string[] set, string table = "", string where = "") { // If more passed than select do a query reset if (!String.IsNullOrEmpty(table) || !String.IsNullOrEmpty(where)) _SQLQuery = new SQLQueryItem(); _SQLQuery.Type = SQLQueryItem.TypeEnum.UPDATE; update_set (set); if (!String.IsNullOrEmpty(table)) _SQLQuery.Table = table; if (!String.IsNullOrEmpty(where)) _SQLQuery.SetFilter(where); return _SQLQuery.build(); }
// SELECT - MASTER public static string Select(string select = "*", string from = "", string where = "", int limit = 0, int offset = 0, string sorting = "") { // If more passed than select do a query reset if (!String.IsNullOrEmpty(from) || !String.IsNullOrEmpty(where) || limit != 0 || offset != 0 || !String.IsNullOrEmpty(sorting)) _SQLQuery = new SQLQueryItem(); _SQLQuery.Type = SQLQueryItem.TypeEnum.SELECT; add_select(select); if (!String.IsNullOrEmpty(from)) _SQLQuery.Table = from; if (!String.IsNullOrEmpty(where)) _SQLQuery.SetFilter(where); if (limit != 0) _SQLQuery.Limit = limit; if (offset != 0) _SQLQuery.Offset = offset; if (!String.IsNullOrEmpty(sorting)) _SQLQuery.SetOrderBy(sorting); return _SQLQuery.build(); }
public static void Reset() { _SQLQuery = new SQLQueryItem(); }
// SINGLE OPERATIONS ///////////// // NEW QUERY public static string New() { _SQLQuery = new SQLQueryItem(); return String.Empty; }
public static string Insert(string into, string[] value) { _SQLQuery = new SQLQueryItem(); _SQLQuery.Type = SQLQueryItem.TypeEnum.INSERT_INTO; _SQLQuery.Table = into; add_insert_value (value); return _SQLQuery.build(); }