ITableStructure GetStructure(DbfFile dbf) { var res = new TableStructure(); //output column names for (int i = 0; i < dbf.Header.ColumnCount; i++) { DbTypeBase type; // convert DBF type to DA type switch (dbf.Header[i].ColumnType) { case DbfColumn.DbfColumnType.Binary: type = new DbTypeBlob(); break; case DbfColumn.DbfColumnType.Boolean: type = new DbTypeLogical(); break; case DbfColumn.DbfColumnType.Date: type = new DbTypeDatetime { SubType = DbDatetimeSubType.Date }; break; case DbfColumn.DbfColumnType.Character: type = new DbTypeString { Length = dbf.Header[i].Length }; break; case DbfColumn.DbfColumnType.Integer: type = new DbTypeInt(); break; case DbfColumn.DbfColumnType.Memo: type = new DbTypeText(); break; case DbfColumn.DbfColumnType.Number: type = new DbTypeNumeric { Precision = dbf.Header[i].DecimalCount }; break; default: type = new DbTypeString(); break; } res.AddColumn(dbf.Header[i].Name, type); } return(res); }
public override DbTypeBase ToGenericType() { if (m_length == 1) { var res = new DbTypeLogical(); res.SetSpecificAttribute("mysql", "subtype", "bit"); return(res); } else { var res = new DbTypeInt { Bytes = 8, Unsigned = true }; res.SetSpecificAttribute("mysql", "subtype", "bit"); res.SetSpecificAttribute("mysql", "bitlength", Length.ToString()); return(res); } }
public override DbTypeBase ToGenericType() { DbTypeLogical res = new DbTypeLogical(); return(res); }
protected override DbTypeBase ToGenericTypeNoArray() { DbTypeLogical res = new DbTypeLogical(); return(res); }