-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHypertableAttribute.cs
More file actions
43 lines (37 loc) · 1.75 KB
/
HypertableAttribute.cs
File metadata and controls
43 lines (37 loc) · 1.75 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
namespace CmdScale.EntityFrameworkCore.TimescaleDB.Configuration.Hypertable
{
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class HypertableAttribute : Attribute
{
/// <summary>
/// The name of the column that contains the time-series data.
/// This is typically a DateTime, DateTimeOffset, or similar type.
/// </summary>
public string TimeColumnName { get; } = string.Empty;
/// <summary>
/// Specifies whether compression is enabled on the hypertable.
/// </summary>
public bool EnableCompression { get; set; } = false;
/// <summary>
/// Specifies whether existing data should be migrated when converting a table to a hypertable.
/// </summary>
public bool MigrateData { get; set; } = false;
/// <summary>
/// Defines the duration of time covered by each chunk in a hypertable.
/// </summary>
public string ChunkTimeInterval { get; set; } = DefaultValues.ChunkTimeInterval;
/// <summary>
/// Enable range statistics for a specific column in a compressed hypertable. This tracks a range of values for that column per chunk.
/// Used for chunk skipping during query optimization and applies only to the chunks created after chunk skipping is enabled.
/// </summary>
public string[]? ChunkSkipColumns { get; set; } = null;
public HypertableAttribute(string timeColumnName)
{
if (string.IsNullOrWhiteSpace(timeColumnName))
{
throw new ArgumentException("Time column name must be provided.", nameof(timeColumnName));
}
TimeColumnName = timeColumnName;
}
}
}