Exemple #1
0
        public DatabaseTableField(string n, DatabaseTableFieldType t, bool pk = false, bool ai = false, bool nn = false, bool u = false)
        {
            name = n.StyleAsEntity();

            field_type        = t;
            is_primary_key    = pk;
            is_auto_increment = ai;
            is_not_null       = nn;
            is_unique         = u;
        }
Exemple #2
0
        static public Type GetSystemType(this DatabaseTableFieldType item)
        {
            switch (item)
            {
            case DatabaseTableFieldType.NULL: return(null);

            case DatabaseTableFieldType.INTEGER: return(typeof(long));

            case DatabaseTableFieldType.REAL: return(typeof(decimal));

            case DatabaseTableFieldType.TEXT: return(typeof(string));

            case DatabaseTableFieldType.BLOB: return(typeof(byte[]));
            }

            throw new UnaccountedBranchException("item", item);
        }
Exemple #3
0
 static public DatabaseTableField NewFieldPrimaryKey(this DatabaseTable item, DatabaseTableFieldType t = DatabaseTableFieldType.INTEGER, bool ai = true)
 {
     return(item.AddField(new DatabaseTableField_PrimaryKey(t, ai)));
 }
Exemple #4
0
 static public DatabaseTableField NewFieldForeignKey(this DatabaseTable item, string n, DatabaseTable t, DatabaseTableFieldType ft = DatabaseTableFieldType.INTEGER, bool nn = false)
 {
     return(item.AddField(new DatabaseTableField_ForeignKey(n, t, ft, nn)));
 }
Exemple #5
0
 static public DatabaseTableField NewFieldNormal(this DatabaseTable item, string n, DatabaseTableFieldType t, bool nn = false, bool u = false)
 {
     return(item.AddField(new DatabaseTableField_Normal(n, t, nn, u)));
 }
Exemple #6
0
 public DatabaseTableField_Normal(string n, DatabaseTableFieldType t, bool nn = false, bool u = false) : base(n, t, false, false, nn, u)
 {
 }
Exemple #7
0
 public DatabaseTableField_PrimaryKey(DatabaseTableFieldType t = DatabaseTableFieldType.INTEGER, bool ai = true) : base("id", t, true, ai, false, true)
 {
 }
Exemple #8
0
 public DatabaseTableField_ForeignKey(string n, DatabaseTable t, DatabaseTableFieldType ft = DatabaseTableFieldType.INTEGER, bool nn = false) : base(n, ft, false, false, nn, false)
 {
     foreign_table = t;
 }