-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSqlColumn.cs
More file actions
99 lines (84 loc) · 2.92 KB
/
SqlColumn.cs
File metadata and controls
99 lines (84 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//-----------------------------------------------------------------------
// <copyright file="SqlColumn.cs" company="P.O.S Informatique">
// Copyright (c) P.O.S Informatique. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace PosInformatique.Testing.Databases
{
/// <summary>
/// Represents a column of a table in SQL database.
/// </summary>
public sealed class SqlColumn : SqlObject
{
internal SqlColumn(
string name,
int position,
string typeName,
short maxLength,
byte precision,
byte scale)
{
this.Name = name;
this.Position = position;
this.TypeName = typeName;
this.MaxLength = maxLength;
this.Precision = precision;
this.Scale = scale;
}
/// <summary>
/// Gets the name of the column.
/// </summary>
public string Name { get; }
/// <summary>
/// Gets the position of the column in the database.
/// </summary>
public int Position { get; }
/// <summary>
/// Gets the type name of the column.
/// </summary>
public string TypeName { get; }
/// <summary>
/// Gets the max length of the column.
/// </summary>
public short MaxLength { get; }
/// <summary>
/// Gets the precision of the column.
/// </summary>
public byte Precision { get; }
/// <summary>
/// Gets the scale of the column.
/// </summary>
public byte Scale { get; }
/// <summary>
/// Gets the collation name of the column.
/// </summary>
public string? CollationName { get; internal set; }
/// <summary>
/// Gets a value indicating whether if the column is nullable.
/// </summary>
public bool IsNullable { get; internal set; }
/// <summary>
/// Gets a value indicating whether if the column is identity.
/// </summary>
public bool IsIdentity { get; internal set; }
/// <summary>
/// Gets a value indicating whether if the column is computed.
/// </summary>
public bool IsComputed { get; internal set; }
/// <summary>
/// Gets the computed expression of the column.
/// </summary>
public string? ComputedExpression { get; internal set; }
/// <summary>
/// Gets the default constraint of the column.
/// </summary>
public SqlDefaultConstraint? DefaultConstraint { get; internal set; }
/// <inheritdoc />
public override TResult Accept<TResult>(ISqlObjectVisitor<TResult> visitor) => visitor.Visit(this);
/// <inheritdoc cref="Name"/>
public override string ToString()
{
return this.Name;
}
}
}