示例#1
0
		protected abstract string ParseColumnAlter(TableColumnSchema mColumn, TableColumnSchema eColumn);
示例#2
0
		protected virtual string MakeDdlColumnDrop(TableColumnSchema column, TableSchema table)
		{
			return string.Format(@"ALTER TABLE {0} DROP COLUMN {1}",
				MakeDdlElementName(table.Name), MakeDdlElementName(column.Name));
		}
示例#3
0
		protected abstract string ParseColumn(TableColumnSchema column);
示例#4
0
		private string MakeDdlColumnCreate(TableColumnSchema column, TableSchema table)
		{
			return string.Format(@"ALTER TABLE {0} ADD {1}",
				MakeDdlElementName(table.Name), ParseColumn(column));
		}
示例#5
0
		protected virtual string MakeDdlColumnAlter(TableColumnSchema mColumn, TableColumnSchema eColumn,
			TableSchema table)
		{
			return string.Format(@"ALTER TABLE {0} ALTER COLUMN {1}",
				MakeDdlElementName(table.Name), ParseColumnAlter(mColumn, eColumn));
		}
示例#6
0
		public virtual IDbDataParameter ConvertToDbParameter(TableColumnSchema column,
			IDbDataParameter parameter)
		{
			parameter.ParameterName = MakeParameterName(column);

			switch (column.Type)
			{
				case ColumnType.Integer:
					parameter.DbType = DbType.Int32;
					break;
				case ColumnType.NCharacterVaring:
				case ColumnType.BlobSubtypeNText:
					parameter.DbType = DbType.String;
					break;
				case ColumnType.Timestamp:
					parameter.DbType = DbType.DateTime;
					break;
				case ColumnType.Boolean:
					parameter.DbType = DbType.Boolean;
					break;
				case ColumnType.TinyInt:
					// Unsigned for some reason
					//
					parameter.DbType = DbType.Byte;
					break;
				case ColumnType.SmallInt:
					parameter.DbType = DbType.Int16;
					break;
				default:
					throw new NotSupportedException(@"Unsupported column type " + column.Type);
			}

			return parameter;
		}
示例#7
0
		protected virtual string MakeParameterName(TableColumnSchema column)
		{
			return @"@" + column.Name;
		}
 protected abstract string ParseColumn(TableColumnSchema column);
 protected abstract string ParseColumnAlter(TableColumnSchema mColumn, TableColumnSchema eColumn);
 protected virtual string MakeDdlColumnDrop(TableColumnSchema column, TableSchema table)
 {
     return(string.Format(@"ALTER TABLE {0} DROP COLUMN {1}",
                          MakeDdlElementName(table.Name), MakeDdlElementName(column.Name)));
 }
 protected virtual string MakeDdlColumnAlter(TableColumnSchema mColumn, TableColumnSchema eColumn,
                                             TableSchema table)
 {
     return(string.Format(@"ALTER TABLE {0} ALTER COLUMN {1}",
                          MakeDdlElementName(table.Name), ParseColumnAlter(mColumn, eColumn)));
 }
 private string MakeDdlColumnCreate(TableColumnSchema column, TableSchema table)
 {
     return(string.Format(@"ALTER TABLE {0} ADD {1}",
                          MakeDdlElementName(table.Name), ParseColumn(column)));
 }
 protected virtual string MakeParameterName(TableColumnSchema column)
 {
     return(@"@" + column.Name);
 }
示例#14
0
		public static bool IsExactColumn(this TableSchema table, TableColumnSchema inputColumn)
		{
			if (inputColumn == null)
				return false;
			var column = table.GetColumn(inputColumn.Name);
			return column != null && column.Equals(inputColumn);
		}