public override string ToString(ISqlDialect dialect)
            {
                var sql = new StringBuilder().AppendFormat("{0} {1} {2} ", Name, dialect.DbTypeToString(type, size, precision), notNull ? "not null" : "null");
                if (defaultValue != null) sql.AppendFormat("default {0} ", defaultValue);
                if (primaryKey) sql.Append("primary key ");
                if (autoinc) sql.Append(dialect.Autoincrement);

                return sql.ToString().Trim();
            }
示例#2
0
            public override string ToString(ISqlDialect dialect)
            {
                var sql = new StringBuilder().AppendFormat("{0} {1} {2} ", Name, dialect.DbTypeToString(type, size, precision), notNull ? "not null" : "null");
                if (defaultValue != null) sql.AppendFormat("default {0} ", defaultValue);
                if (primaryKey) sql.Append("primary key ");
                if (autoinc) sql.Append(dialect.Autoincrement);

                return sql.ToString().Trim();
            }