Beispiel #1
0
        static public string GetQuery(MonoSQLiteManager dbManager, System.Type table)
        {
            Dictionary <string, ColumnInfo> columns = new Dictionary <string, ColumnInfo>();

            FieldInfo[] fields = table.GetFields();
            for (int i = 0; i < fields.Length; ++i)
            {
                string     attributes = DBFieldAttribute.GetDBAttributes(fields[i]);
                ColumnInfo c          = new ColumnInfo(fields[i].Name, dbManager.GetCTypeToSqlType(fields[i].FieldType), attributes);
                columns.Add(c._name, c);
            }

            return(GetQuery(dbManager, table.Name, columns));
        }
Beispiel #2
0
        static public string GetQuery(MonoSQLiteManager dbManager, string tableName, string columnName, System.Type type)
        {
            string fieldType = dbManager.GetCTypeToSqlType(type);

            return("ALTER TABLE " + tableName + " ADD COLUMN " + columnName + " " + fieldType);
        }