/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="length"></param> /// <param name="allowNull"></param> public TableColumn(string name, GenericDbColumnType dataType, int length, bool allowNull) { this.name = name; this.dataType = dataType; this.length = length; this.allowNull = allowNull; }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="allowNull"></param> /// <param name="isPrimaryKey"></param> public TableColumn(string name, GenericDbColumnType dataType, bool allowNull, bool isPrimaryKey) { this.name = name; this.dataType = dataType; this.allowNull = allowNull; this.isPrimaryKey = isPrimaryKey; }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="precision"></param> /// <param name="scale"></param> /// <param name="allowNull"></param> public TableColumn(string name, GenericDbColumnType dataType, int precision, int scale, bool allowNull) { this.name = name; this.dataType = dataType; this.precision = precision; this.scale = scale; this.allowNull = allowNull; }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="allowNull"></param> /// <param name="foreignKeyTableName"></param> /// <param name="foreignKeyColumnName"></param> public TableColumn(string name, GenericDbColumnType dataType, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName) { this.name = name; this.dataType = dataType; this.allowNull = allowNull; this.foreignKeyTableName = foreignKeyTableName; this.foreignKeyColumnName = foreignKeyColumnName; }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="allowNull"></param> /// <param name="foreignKeyTableName"></param> /// <param name="foreignKeyColumnName"></param> /// <param name="cascadeDelete">A value indicating whether or not to cascade on delete</param> public TableColumn(string name, GenericDbColumnType dataType, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName, bool cascadeDelete) { this.name = name; this.dataType = dataType; this.allowNull = allowNull; this.foreignKeyTableName = foreignKeyTableName; this.foreignKeyColumnName = foreignKeyColumnName; this.cascadeDelete = cascadeDelete; }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="precision"></param> /// <param name="scale"></param> /// <param name="allowNull"></param> /// <param name="foreignKeyTableName"></param> /// <param name="foreignKeyColumnName"></param> public TableColumn(string name, GenericDbColumnType dataType, int precision, int scale, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName) { this.name = name; this.dataType = dataType; this.precision = precision; this.scale = scale; this.allowNull = allowNull; this.foreignKeyTableName = foreignKeyTableName; this.foreignKeyColumnName = foreignKeyColumnName; }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="precision"></param> /// <param name="scale"></param> /// <param name="allowNull"></param> /// <param name="isPrimaryKey"></param> public TableColumn(string name, GenericDbColumnType dataType, int precision, int scale, bool allowNull, bool isPrimaryKey) { this.name = name; this.dataType = dataType; this.precision = precision; this.scale = scale; this.allowNull = allowNull; this.isPrimaryKey = isPrimaryKey; }
/// <summary> /// Set REDCap Data Type mapping /// </summary> /// <param name="dataType">DataType</param> /// <returns>String</returns> public override string GetDbSpecificColumnType(GenericDbColumnType dataType) { switch (dataType) { case GenericDbColumnType.AnsiString: case GenericDbColumnType.AnsiStringFixedLength: case GenericDbColumnType.Byte: case GenericDbColumnType.Guid: case GenericDbColumnType.String: case GenericDbColumnType.StringFixedLength: return("text"); case GenericDbColumnType.Binary: return("binary"); case GenericDbColumnType.Boolean: return("bool"); case GenericDbColumnType.Currency: case GenericDbColumnType.Double: return("double"); case GenericDbColumnType.Date: return("date"); case GenericDbColumnType.DateTime: return("datetime"); case GenericDbColumnType.Decimal: return("decimal"); case GenericDbColumnType.Image: return("blob"); case GenericDbColumnType.Int16: case GenericDbColumnType.UInt16: return("smallint"); case GenericDbColumnType.Int32: case GenericDbColumnType.UInt32: return("integer"); case GenericDbColumnType.Int64: case GenericDbColumnType.UInt64: return("bigint"); case GenericDbColumnType.Object: return("blob"); case GenericDbColumnType.SByte: return("tinyint"); case GenericDbColumnType.Single: return("float"); case GenericDbColumnType.StringLong: return("longtext"); case GenericDbColumnType.Time: return("time"); case GenericDbColumnType.VarNumeric: return("decimal"); case GenericDbColumnType.Xml: return("mediumtext"); default: throw new GeneralException("genericDbColumnType is unknown"); } }
public override string GetDbSpecificColumnType(GenericDbColumnType dataType) { throw new NotImplementedException(); }
/// <summary> /// Set MySQL Data Type mapping /// </summary> /// <param name="dataType">DataType</param> /// <returns>String</returns> public override string GetDbSpecificColumnType(GenericDbColumnType dataType) { switch (dataType) { case GenericDbColumnType.AnsiString: case GenericDbColumnType.AnsiStringFixedLength: case GenericDbColumnType.Byte: case GenericDbColumnType.Guid: case GenericDbColumnType.String: case GenericDbColumnType.StringFixedLength: return "text"; case GenericDbColumnType.Binary: return "binary"; case GenericDbColumnType.Boolean: return "bool"; case GenericDbColumnType.Currency: case GenericDbColumnType.Double: return "double"; case GenericDbColumnType.Date: return "date"; case GenericDbColumnType.DateTime: return "datetime"; case GenericDbColumnType.Decimal: return "decimal"; case GenericDbColumnType.Image: return PostgreSQLDbColumnType.Longblob; case GenericDbColumnType.Int16: case GenericDbColumnType.UInt16: return "smallint"; case GenericDbColumnType.Int32: case GenericDbColumnType.UInt32: return "integer"; case GenericDbColumnType.Int64: case GenericDbColumnType.UInt64: return "bigint"; case GenericDbColumnType.Object: return "blob"; case GenericDbColumnType.SByte: return "tinyint"; case GenericDbColumnType.Single: return "float"; case GenericDbColumnType.StringLong: return "longtext"; case GenericDbColumnType.Time: return "time"; case GenericDbColumnType.VarNumeric: return "decimal"; case GenericDbColumnType.Xml: return "mediumtext"; default: throw new GeneralException("genericDbColumnType is unknown"); } }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name">Name of the column</param> /// <param name="dataType">The column's data type</param> /// <param name="allowNull">A value indicating whether or not the column can be null</param> public TableColumn(string name, GenericDbColumnType dataType, bool allowNull) { this.name = name; this.dataType = dataType; this.allowNull = allowNull; }
/// <summary> /// Returns database sepecific column type /// </summary> /// <param name="dataType"></param> /// <returns></returns> public abstract string GetDbSpecificColumnType(GenericDbColumnType dataType);
/// <summary> /// Gets the database-specific column data type. /// </summary> /// <param name="dataType">An extension of the System.Data.DbType that adds StringLong (Text, Memo) data type that Epi Info commonly uses.</param> /// <returns>Database-specific column data type.</returns> public override string GetDbSpecificColumnType(GenericDbColumnType dataType) { switch (dataType) { case GenericDbColumnType.AnsiString: case GenericDbColumnType.String: return "nvarchar"; case GenericDbColumnType.AnsiStringFixedLength: case GenericDbColumnType.StringFixedLength: return "nchar"; case GenericDbColumnType.Binary: return "binary"; case GenericDbColumnType.Boolean: return "bit"; case GenericDbColumnType.Byte: return "tinyint"; case GenericDbColumnType.Currency: return "money"; case GenericDbColumnType.Date: case GenericDbColumnType.DateTime: case GenericDbColumnType.Time: return "datetime"; case GenericDbColumnType.Decimal: return "decimal"; case GenericDbColumnType.Double: return "float"; case GenericDbColumnType.Guid: return "uniqueidentifier"; case GenericDbColumnType.Image: return "image"; case GenericDbColumnType.Int16: case GenericDbColumnType.UInt16: return "smallint"; case GenericDbColumnType.Int32: case GenericDbColumnType.UInt32: return "int"; case GenericDbColumnType.Int64: case GenericDbColumnType.UInt64: return "bigint"; case GenericDbColumnType.Object: return "binary"; case GenericDbColumnType.SByte: return "tinyint"; case GenericDbColumnType.Single: return "real"; case GenericDbColumnType.StringLong: return "ntext"; case GenericDbColumnType.VarNumeric: return "decimal"; case GenericDbColumnType.Xml: return "xml"; default: throw new GeneralException("genericDbColumnType is unknown"); // return "nvarchar"; } }
/// <summary> /// Gets the database-specific column data type. /// </summary> /// <param name="dataType">An extension of the System.Data.DbType that adds StringLong (Text, Memo) data type that Epi Info commonly uses.</param> /// <returns>Database-specific column data type.</returns> public override string GetDbSpecificColumnType(GenericDbColumnType dataType) { switch (dataType) { case GenericDbColumnType.AnsiString: case GenericDbColumnType.AnsiStringFixedLength: return AccessColumnType.Text; case GenericDbColumnType.Binary: return "binary"; case GenericDbColumnType.Boolean: return AccessColumnType.YesNo; case GenericDbColumnType.Byte: return "byte"; case GenericDbColumnType.Currency: return AccessColumnType.Currency; case GenericDbColumnType.Date: case GenericDbColumnType.DateTime: case GenericDbColumnType.Time: return "datetime"; case GenericDbColumnType.Decimal: case GenericDbColumnType.Double: return "double"; case GenericDbColumnType.Guid: return "text"; case GenericDbColumnType.Int16: case GenericDbColumnType.UInt16: return "SHORT"; case GenericDbColumnType.Int32: case GenericDbColumnType.UInt32: return "integer"; case GenericDbColumnType.Int64: case GenericDbColumnType.UInt64: return "LONG"; case GenericDbColumnType.Object: case GenericDbColumnType.Image: return "LONGBINARY"; case GenericDbColumnType.SByte: return "byte"; case GenericDbColumnType.Single: return "single"; case GenericDbColumnType.String: case GenericDbColumnType.StringFixedLength: return "text"; case GenericDbColumnType.StringLong: case GenericDbColumnType.Xml: return "MEMO"; case GenericDbColumnType.VarNumeric: return "double"; default: throw new GeneralException("genericDbColumnType is unknown"); } }
/// <summary> /// Gets the database-specific column data type. /// </summary> /// <param name="dataType">An extension of the System.Data.DbType that adds StringLong (Text, Memo) data type that Epi Info commonly uses.</param> /// <returns>Database-specific column data type.</returns> public override string GetDbSpecificColumnType(GenericDbColumnType dataType) { switch (dataType) { case GenericDbColumnType.AnsiString: case GenericDbColumnType.AnsiStringFixedLength: return(AccessColumnType.Text); case GenericDbColumnType.Binary: return("binary"); case GenericDbColumnType.Boolean: return(AccessColumnType.YesNo); // "yesno"; case GenericDbColumnType.Byte: return("byte"); case GenericDbColumnType.Currency: return(AccessColumnType.Currency); // "CURRENCY"; case GenericDbColumnType.Date: case GenericDbColumnType.DateTime: case GenericDbColumnType.Time: return("datetime"); case GenericDbColumnType.Decimal: case GenericDbColumnType.Double: return("double"); case GenericDbColumnType.Guid: return("GUID"); case GenericDbColumnType.Int16: case GenericDbColumnType.UInt16: return("SHORT"); case GenericDbColumnType.Int32: case GenericDbColumnType.UInt32: return("integer"); case GenericDbColumnType.Int64: case GenericDbColumnType.UInt64: return("LONG"); case GenericDbColumnType.Object: case GenericDbColumnType.Image: return("LONGBINARY"); case GenericDbColumnType.SByte: return("byte"); case GenericDbColumnType.Single: return("single"); case GenericDbColumnType.String: case GenericDbColumnType.StringFixedLength: return("text"); case GenericDbColumnType.StringLong: case GenericDbColumnType.Xml: return("MEMO"); case GenericDbColumnType.VarNumeric: return("double"); default: throw new GeneralException("genericDbColumnType is unknown"); // return "text"; } }
/// <summary> /// Initializes a new instance of the TableColumn class. /// </summary> /// <param name="name"></param> /// <param name="dataType"></param> /// <param name="length"></param> /// <param name="allowNull"></param> /// <param name="foreignKeyTableName"></param> /// <param name="foreignKeyColumnName"></param> public TableColumn(string name, GenericDbColumnType dataType, int length, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName) { this.name = name; this.dataType = dataType; this.length = length; this.allowNull = allowNull; this.foreignKeyTableName = foreignKeyTableName; this.foreignKeyColumnName = foreignKeyColumnName; }