2121namespace DataStax . AstraDB . DataApi . Tables ;
2222
2323
24+ /// <summary>
25+ /// Represents a column in a table
26+ /// </summary>
2427[ JsonConverter ( typeof ( ColumnConverter ) ) ]
2528public abstract class Column
2629{
30+ /// <summary>
31+ /// The type of the column
32+ /// </summary>
2733 [ JsonIgnore ]
2834 public abstract string Type { get ; }
2935}
3036
37+ /// <summary>
38+ /// A column that holds text values
39+ /// </summary>
3140public class TextColumn : Column
3241{
42+ /// <summary>
43+ /// Defines the column as type text
44+ /// </summary>
3345 [ JsonPropertyName ( "type" ) ]
3446 public override string Type => "text" ;
3547}
3648
49+ /// <summary>
50+ /// A column that holds UUID values
51+ /// </summary>
3752public class GuidColumn : Column
3853{
54+ /// <summary>
55+ /// Defines the column as type uuid
56+ /// </summary>
3957 [ JsonPropertyName ( "type" ) ]
4058 public override string Type => "uuid" ;
4159}
4260
61+ /// <summary>
62+ /// A column that holds integer values
63+ /// </summary>
4364public class IntColumn : Column
4465{
66+ /// <summary>
67+ /// Defines the column as type int
68+ /// </summary>
4569 [ JsonPropertyName ( "type" ) ]
4670 public override string Type => "int" ;
4771}
4872
73+ /// <summary>
74+ /// A column that holds long integer values
75+ /// </summary>
4976public class LongColumn : Column
5077{
78+ /// <summary>
79+ /// Defines the column as type bigint
80+ /// </summary>
5181 [ JsonPropertyName ( "type" ) ]
5282 public override string Type => "bigint" ;
5383}
5484
85+ /// <summary>
86+ /// A column that holds decimal values
87+ /// </summary>
5588public class DecimalColumn : Column
5689{
90+ /// <summary>
91+ /// Defines the column as type decimal
92+ /// </summary>
5793 [ JsonPropertyName ( "type" ) ]
5894 public override string Type => "decimal" ;
5995}
6096
97+ /// <summary>
98+ /// A column that holds float values
99+ /// </summary>
61100public class FloatColumn : Column
62101{
102+ /// <summary>
103+ /// Defines the column as type float
104+ /// </summary>
63105 [ JsonPropertyName ( "type" ) ]
64106 public override string Type => "float" ;
65107}
66108
109+ /// <summary>
110+ /// A column that holds double values
111+ /// </summary>
67112public class DoubleColumn : Column
68113{
114+ /// <summary>
115+ /// Defines the column as type double
116+ /// </summary>
69117 [ JsonPropertyName ( "type" ) ]
70118 public override string Type => "double" ;
71119}
72120
121+ /// <summary>
122+ /// A column that holds boolean values
123+ /// </summary>
73124public class BooleanColumn : Column
74125{
126+ /// <summary>
127+ /// Defines the column as type boolean
128+ /// </summary>
75129 [ JsonPropertyName ( "type" ) ]
76130 public override string Type => "boolean" ;
77131}
78132
133+ /// <summary>
134+ /// A column that holds date/time values
135+ /// </summary>
79136public class DateTimeColumn : Column
80137{
138+ /// <summary>
139+ /// Defines the column as type timestamp
140+ /// </summary>
81141 [ JsonPropertyName ( "type" ) ]
82142 public override string Type => "timestamp" ;
83143}
84144
145+ /// <summary>
146+ /// A column that holds binary values
147+ /// </summary>
85148public class BlobColumn : Column
86149{
150+ /// <summary>
151+ /// Defines the column as type blob
152+ /// </summary>
87153 [ JsonPropertyName ( "type" ) ]
88154 public override string Type => "blob" ;
89155}
90156
157+ /// <summary>
158+ /// A column that holds IP address values
159+ /// </summary>
91160public class IPAddressColumn : Column
92161{
162+ /// <summary>
163+ /// Defines the column as type inet
164+ /// </summary>
93165 [ JsonPropertyName ( "type" ) ]
94166 public override string Type => "inet" ;
95167}
96168
169+ /// <summary>
170+ /// A column that holds duration values
171+ /// </summary>
97172public class DurationColumn : Column
98173{
174+ /// <summary>
175+ /// Defines the column as type duration
176+ /// </summary>
99177 [ JsonPropertyName ( "type" ) ]
100178 public override string Type => "duration" ;
101179}
102180
181+ /// <summary>
182+ /// A column that holds dictionary/map values
183+ /// </summary>
103184public class DictionaryColumn : Column
104185{
186+ /// <summary>
187+ /// Defines the column as type map
188+ /// </summary>
105189 [ JsonPropertyName ( "type" ) ]
106190 public override string Type => "map" ;
107191
192+ /// <summary>
193+ /// The type of the keys in the dictionary
194+ /// </summary>
108195 [ JsonPropertyName ( "keyType" ) ]
109196 public string KeyType { get ; set ; }
110197
198+ /// <summary>
199+ /// The type of the values in the dictionary
200+ /// </summary>
111201 [ JsonPropertyName ( "valueType" ) ]
112202 public string ValueType { get ; set ; }
113203
@@ -117,14 +207,26 @@ internal DictionaryColumn(string keyType, string valueType)
117207 ValueType = valueType ;
118208 }
119209
210+ /// <summary>
211+ /// Creates a new instance of the <see cref="DictionaryColumn"/> class.
212+ /// </summary>
120213 public DictionaryColumn ( ) { }
121214}
122215
216+ /// <summary>
217+ /// A column that holds list/array values
218+ /// </summary>
123219public class ListColumn : Column
124220{
221+ /// <summary>
222+ /// Defines the column as type list
223+ /// </summary>
125224 [ JsonPropertyName ( "type" ) ]
126225 public override string Type => "list" ;
127226
227+ /// <summary>
228+ /// The type of the values in the list
229+ /// </summary>
128230 [ JsonPropertyName ( "valueType" ) ]
129231 public string ValueType { get ; set ; }
130232
@@ -133,14 +235,26 @@ internal ListColumn(string valueType)
133235 ValueType = valueType ;
134236 }
135237
238+ /// <summary>
239+ /// Creates a new instance of the <see cref="ListColumn"/> class.
240+ /// </summary>
136241 public ListColumn ( ) { }
137242}
138243
244+ /// <summary>
245+ /// A column that holds set values
246+ /// </summary>
139247public class SetColumn : Column
140248{
249+ /// <summary>
250+ /// Defines the column as type set
251+ /// </summary>
141252 [ JsonPropertyName ( "type" ) ]
142253 public override string Type => "set" ;
143254
255+ /// <summary>
256+ /// The type of the values in the set
257+ /// </summary>
144258 [ JsonPropertyName ( "valueType" ) ]
145259 public string ValueType { get ; set ; }
146260
@@ -149,14 +263,26 @@ internal SetColumn(string valueType)
149263 ValueType = valueType ;
150264 }
151265
266+ /// <summary>
267+ /// Creates a new instance of the <see cref="SetColumn"/> class.
268+ /// </summary>
152269 public SetColumn ( ) { }
153270}
154271
272+ /// <summary>
273+ /// A column that holds vector values
274+ /// </summary>
155275public class VectorColumn : Column
156276{
277+ /// <summary>
278+ /// Defines the column as type vector
279+ /// </summary>
157280 [ JsonPropertyName ( "type" ) ]
158281 public override string Type => "vector" ;
159282
283+ /// <summary>
284+ /// The dimension of the vector
285+ /// </summary>
160286 [ JsonPropertyName ( "dimension" ) ]
161287 public int Dimension { get ; set ; }
162288
@@ -165,18 +291,44 @@ internal VectorColumn(int dimension)
165291 Dimension = dimension ;
166292 }
167293
294+ /// <summary>
295+ /// Creates a new instance of the <see cref="VectorColumn"/> class.
296+ /// </summary>
168297 public VectorColumn ( ) { }
169298}
170299
300+ /// <summary>
301+ /// A column that holds vector values that are generated by a vectorization service
302+ /// </summary>
171303public class VectorizeColumn : VectorColumn
172304{
305+ /// <summary>
306+ /// The vectorization service options
307+ /// </summary>
173308 [ JsonPropertyName ( "service" ) ]
174309 public VectorServiceOptions ServiceOptions { get ; set ; }
175310
311+ /// <summary>
312+ /// Creates a new instance of the <see cref="VectorizeColumn"/> class with the specified dimension and service options.
313+ /// </summary>
314+ /// <param name="dimension"></param>
315+ /// <param name="serviceOptions"></param>
176316 public VectorizeColumn ( int dimension , VectorServiceOptions serviceOptions ) : base ( dimension )
177317 {
178318 ServiceOptions = serviceOptions ;
179319 }
180320
321+ /// <summary>
322+ /// Creates a new instance of the <see cref="VectorizeColumn"/> class with the specified service options.
323+ /// </summary>
324+ /// <param name="serviceOptions"></param>
325+ public VectorizeColumn ( VectorServiceOptions serviceOptions )
326+ {
327+ ServiceOptions = serviceOptions ;
328+ }
329+
330+ /// <summary>
331+ /// Creates a new instance of the <see cref="VectorizeColumn"/> class.
332+ /// </summary>
181333 public VectorizeColumn ( ) { }
182334}
0 commit comments