public ClickHouseColumn GetOrAddDateColumn(string timeColumnName, string dateColumnName)
        {
            ClickHouseColumn column = GetDateColumn();

            if (column == null)
            {
                column = AddDateColumn(timeColumnName, dateColumnName);
            }
            return(column);
        }
        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);
        }
Beispiel #3
0
 public ClickHouseReference(ClickHouseColumn foreignKey, Type entityType, bool permanent)
 {
     ForeignKey = foreignKey;
     EntityType = entityType;
     Permanent  = permanent;
 }
 internal static ClickHouseColumn[] GetColumns <T>() => typeof(T).GetProperties().Select(t => ClickHouseColumn.Create(t)).ToArray();