Ejemplo n.º 1
0
        public override DbTypeBase ToGenericType()
        {
            DbTypeDatetime res = new DbTypeDatetime();

            res.SetSpecificAttribute("mssql", "subtype", "timestamp");
            return(res);
        }
Ejemplo n.º 2
0
        public override DbTypeBase ToGenericType()
        {
            var res = new DbTypeDatetime();

            res.SubType = DbDatetimeSubType.Datetime;
            return(res);
        }
Ejemplo n.º 3
0
        public override DbTypeBase ToGenericType()
        {
            DbTypeDatetime res = new DbTypeDatetime();

            res.HasTimeZone = true;
            return(res);
        }
Ejemplo n.º 4
0
        private MySqlTypeBase GetMySqlTypeDatetime(DbTypeDatetime type, IMySqlMigrationProfile profile, IProgressInfo progress)
        {
            switch (((DbTypeDatetime)type).SubType)
            {
            case DbDatetimeSubType.Date: return(new MySqlTypeDate());

            case DbDatetimeSubType.Time: return(new MySqlTypeTime());

            case DbDatetimeSubType.Datetime:
            {
                if (type.GetSpecificAttribute("mysql", "subtype") == "timestamp")
                {
                    return(new MySqlTypeTimestamp());
                }
                if (type.GetSpecificAttribute("mysql", "subtype") == "datetime")
                {
                    return(new MySqlTypeDatetime());
                }
                if (profile != null)
                {
                    switch (profile.DateTimeAffinity)
                    {
                    case MySqlDateTimeAffinity.DateTime: return(new MySqlTypeDatetime());

                    case MySqlDateTimeAffinity.Timespamp: return(new MySqlTypeTimestamp());
                    }
                }
                return(new MySqlTypeTimestamp());
            }

            case DbDatetimeSubType.Year: return(new MySqlTypeYear());
            }
            return(new MySqlTypeDatetime());
        }
Ejemplo n.º 5
0
 private ISpecificType GetPostgreSqlTypeDatetime(DbTypeDatetime type)
 {
     if (type.SubType == DbDatetimeSubType.Interval)
     {
         return(new PostgreSqlTypeInterval());
     }
     if (type.SubType == DbDatetimeSubType.Time)
     {
         if (type.HasTimeZone)
         {
             return(new PostgreSqlTypeTimeTz());
         }
         return(new PostgreSqlTypeTime());
     }
     if (type.SubType == DbDatetimeSubType.Datetime)
     {
         if (type.HasTimeZone)
         {
             return(new PostgreSqlTypeTimestampTz());
         }
         return(new PostgreSqlTypeTimestamp());
     }
     if (type.SubType == DbDatetimeSubType.Date)
     {
         return(new PostgreSqlTypeDate());
     }
     return(new PostgreSqlTypeTimestamp());
 }
Ejemplo n.º 6
0
        protected override DbTypeBase ToGenericTypeNoArray()
        {
            DbTypeDatetime res = new DbTypeDatetime();

            res.SubType = DbDatetimeSubType.Interval;
            return(res);
        }
Ejemplo n.º 7
0
        public override DbTypeBase ToGenericType()
        {
            DbTypeDatetime res = new DbTypeDatetime();

            res.SubType = DbDatetimeSubType.Datetime;
            res.SetSpecificAttribute("effiproz", "subtype", "date");
            return(res);
        }
Ejemplo n.º 8
0
        protected override DbTypeBase ToGenericTypeNoArray()
        {
            DbTypeDatetime res = new DbTypeDatetime();

            res.SubType     = DbDatetimeSubType.Datetime;
            res.HasTimeZone = true;
            return(res);
        }
Ejemplo n.º 9
0
        //int m_precision = 3;
        //[DatAdmin.DisplayName("s_precision")]
        //public int Precision
        //{
        //    get { return m_precision; }
        //    set { m_precision = value; }
        //}

        public override DbTypeBase ToGenericType()
        {
            DbTypeDatetime res = new DbTypeDatetime();

            res.SubType = DbDatetimeSubType.Interval;
            res.SetSpecificAttribute("effiproz", "subtype", SubType);
            //res.SetSpecificAttribute("effiproz", "precision", Precision.ToString());
            return(res);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        public override DbTypeBase ToGenericType()
        {
            var res = new DbTypeDatetime();

            res.SubType = DbDatetimeSubType.Interval;
            res.SetSpecificAttribute("oracle", "subtype", "yeartomonth");
            if (YearPrecision != null)
            {
                res.SetSpecificAttribute("oracle", "yearprecision", YearPrecision.ToString());
            }
            return(res);
        }
Ejemplo n.º 12
0
        public override DbTypeBase ToGenericType()
        {
            var res = new DbTypeDatetime();

            res.SubType     = DbDatetimeSubType.Datetime;
            res.HasTimeZone = TimeZone != TimeZoneType.None;
            res.SetSpecificAttribute("oracle", "subtype", "timestamp");
            res.SetSpecificAttribute("oracle", "timezone", TimeZone.ToString().ToLower());
            if (FractionalPrecision != null)
            {
                res.SetSpecificAttribute("oracle", "fractionalprecision", FractionalPrecision.ToString());
            }
            return(res);
        }
Ejemplo n.º 13
0
        public override DbTypeBase ToGenericType()
        {
            var res = new DbTypeDatetime();

            res.SubType = DbDatetimeSubType.Interval;
            res.SetSpecificAttribute("oracle", "subtype", "daytosecond");
            if (DayPrecision != null)
            {
                res.SetSpecificAttribute("oracle", "dayprecision", DayPrecision.ToString());
            }
            if (FractionalPrecision != null)
            {
                res.SetSpecificAttribute("oracle", "fractionalprecision", FractionalPrecision.ToString());
            }
            return(res);
        }
Ejemplo n.º 14
0
        public override DbTypeBase ToGenericType()
        {
            DbTypeDatetime res = new DbTypeDatetime();

            return(res);
        }