Exemplo n.º 1
0
 public int selectCount(string tableName, string column, SelectOptions options)
 {
     //return (int)select(tableName, String.Format("COUNT({0})", column), options);
     return 0;
 }
Exemplo n.º 2
0
 public bool tableExists(string tableName)
 {
     SelectOptions options = new SelectOptions();
     options.where = String.Format("type='table' and name='{0}'", tableName);
     try
     {
         string name = tableGetString(select("sqlite_master", "name", options, true), "name");
         return true;
     }
     catch
     {
         return false;
     }
 }
Exemplo n.º 3
0
 public DataTable selectColumns(string tableName, string[] columns, SelectOptions options)
 {
     return select(tableName, String.Join(", ", columns), options);
 }
Exemplo n.º 4
0
 public DataTable selectColumn(string tableName, string column, SelectOptions options)
 {
     return select(tableName, column, options);
 }
Exemplo n.º 5
0
 public DataTable selectAll(string tableName, SelectOptions options)
 {
     return select(tableName, "*", options);
 }
Exemplo n.º 6
0
        /*
         * SELECT methods.
         */
        public DataTable select(string tableName, string columns, SelectOptions options, bool skipExistCheck = false)
        {
            if (!skipExistCheck && !tableExists(tableName))
                throw new InvalidOperationException(String.Format("Table '{0}' does not exist", tableName));

            string commandText = String.Format("SELECT {0} FROM {1} {2};", columns, tableName, options.toString());
            /*DataTable result = new DataTable();

            using (SQLiteCommand command = conn.CreateCommand())
            {
                command.CommandText = commandText;
                SQLiteDataReader reader = command.ExecuteReader();
                result.Load(reader);
            }

            return result;*/
            return executeSQLString(commandText);
        }
Exemplo n.º 7
0
 public Migration(string type, string tableName, string[] fields, object[] values, SelectOptions selectoptions = null, string where = "")
 {
     this.type = type;
     this.tableName = tableName;
     if (fields != null)
         this.fields = new List<string>(fields);
     if (values != null)
         this.values = new List<object>(values);
     this.selectoptions = selectoptions;
     this.where = where;
 }