Exemplo n.º 1
0
        public static string SqlDecl(DirectTableMappingColumn p, bool storeDateTimeAsTicks)
        {
            string decl = "\"" + p.Name + "\" " + SqlType(p, storeDateTimeAsTicks) + " ";

            if (p.IsPK)
            {
                decl += "primary key ";
            }
            if (p.IsAutoInc)
            {
                decl += "autoincrement ";
            }
            if (!p.IsNullable)
            {
                decl += "not null ";
            }
            if (!string.IsNullOrEmpty(p.Collation))
            {
                decl += "collate " + p.Collation + " ";
            }

            return(decl);
        }
Exemplo n.º 2
0
 public static string SqlType(DirectTableMappingColumn column, bool storeDateTimeAsTicks = false)
 {
     return(SqlType(column.TargetType, column.MaxStringLength, storeDateTimeAsTicks));
 }