Пример #1
0
        public ClickHouseColumn GetOrAddDateColumn(string timeColumnName, string dateColumnName)
        {
            ClickHouseColumn column = GetDateColumn();

            if (column == null)
            {
                column = AddDateColumn(timeColumnName, dateColumnName);
            }
            return(column);
        }
Пример #2
0
        public ClickHouseColumn AddDateColumn(string timeColumnName, string dateColumnName)
        {
            ClickHouseColumn column = new ClickHouseColumn(name: dateColumnName
                                                           , valueType: ClickHouseValueType.Date
                                                           , mappingSide: ColumnMappingSide.OnlyTarget)
            {
                DefaultExpression = $"toDate({timeColumnName})"
            };

            Columns.Add(column);
            return(column);
        }
Пример #3
0
 public ClickHouseReference(ClickHouseColumn foreignKey, Type entityType, bool permanent)
 {
     ForeignKey = foreignKey;
     EntityType = entityType;
     Permanent  = permanent;
 }
Пример #4
0
 internal static ClickHouseColumn[] GetColumns <T>() => typeof(T).GetProperties().Select(t => ClickHouseColumn.Create(t)).ToArray();