/// <summary> /// Obtains the string of the type /// </summary> /// <param name="type"></param> /// <returns></returns> static public string GetTypeString(SQLiteColumnsType type) { switch (type) { case SQLiteColumnsType.Integer: return("INTEGER"); case SQLiteColumnsType.DateTime: return("DATETIME"); case SQLiteColumnsType.Real: return("REAL"); case SQLiteColumnsType.Text: return("TEXT"); default: // SQLiteColumnsType.BLOB return("BLOB"); } }
/// <summary> /// Add column /// </summary> public void Add(string name, SQLiteColumnsType type, object defaultValue) { Add(new SQLiteColumn(name, type, null)); }
/// <summary> /// Add column /// </summary> public void Add(string name, SQLiteColumnsType type) { Add(name, type, null); }
/// <summary> /// Create a new column with the specified name, type and default value /// </summary> /// <param name="name"></param> /// <param name="type"></param> /// <param name="defaultValue"></param> public SQLiteColumn(string name, SQLiteColumnsType type, object defaultValue) { Name = name.Trim().Regex("(\n|\r)", ""); Type = type; DefaultValue = defaultValue; }
/// <summary> /// Create a new column with the specified name and type /// </summary> /// <param name="name"></param> /// <param name="type"></param> public SQLiteColumn(string name, SQLiteColumnsType type) : this(name, type, null) { }