Dashing.Engine.Dialects.SqlDialectBase.AppendColumnSpecificationWithoutName C# (CSharp) Méthode

AppendColumnSpecificationWithoutName() protected méthode

protected AppendColumnSpecificationWithoutName ( StringBuilder sql, IColumn column, bool scriptDefault = true ) : void
sql StringBuilder
column IColumn
scriptDefault bool
Résultat void
        protected void AppendColumnSpecificationWithoutName(StringBuilder sql, IColumn column, bool scriptDefault = true) {
            sql.Append(this.TypeName(column.DbType));

            if (column.DbType.TypeTakesLength()) {
                sql.Append("(");
                if (column.MaxLength) {
                    sql.Append("max");
                }
                else {
                    sql.Append(column.Length);
                }

                sql.Append(")");
            }

            if (column.DbType.TypeTakesPrecisionAndScale()) {
                this.AppendPrecisionAndScale(sql, column.Precision, column.Scale);
            }

            sql.Append(column.IsNullable ? " null" : " not null");

            if (scriptDefault && !string.IsNullOrEmpty(column.Default) && !column.IsPrimaryKey && !column.IsAutoGenerated) {
                this.AppendDefault(sql, column);
            }

            if (column.IsAutoGenerated) {
                this.AppendAutoGenerateModifier(sql, column);
            }

            if (column.IsPrimaryKey) {
                sql.Append(" primary key");
            }
        }