public virtual object Clone()
        {
            SQLiteTableConstraint res = new SQLiteTableConstraint();

            res._name = _name;
            return(res);
        }
        /// <summary>
        /// Used to merge CONSTRAINT xxx / NEXT constraint pairs (they are actually the
        /// same constraint).
        /// </summary>
        /// <param name="cons">The list to merge</param>
        /// <returns>The resulting (merged) constraints list</returns>
        public static List <SQLiteTableConstraint> Merge(List <SQLiteTableConstraint> cons)
        {
            List <SQLiteTableConstraint> res = new List <SQLiteTableConstraint>();

            for (int i = 0; i < cons.Count; i++)
            {
                SQLiteTableConstraint c = cons[i];
                if (c.GetType() == typeof(SQLiteTableConstraint) && c.ConstraintName != null)
                {
                    i++;
                    if (i < cons.Count)
                    {
                        SQLiteTableConstraint next = cons[i];
                        next.ConstraintName = c.ConstraintName;
                        res.Add(next);
                    }
                }
                else
                {
                    res.Add(c);
                }
            } // for

            return(res);
        }
 public SQLiteCreateTableStatement(List <SQLiteColumnStatement> columns, List <SQLiteTableConstraint> constraints)
 {
     _columns = columns;
     if (constraints != null)
     {
         _constraints = SQLiteTableConstraint.Merge(constraints);
     }
     else
     {
         _constraints = null;
     }
 }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            SQLiteTableConstraint dst = obj as SQLiteTableConstraint;

            if (dst == null)
            {
                return(false);
            }

            return(this.ConstraintName == dst.ConstraintName);
        }