public void Select_specific_field_and_tag() { var testMeasurement = new TaggedMeasurement <Fields, Tags>("test"); var select = InfluxQuery.From(testMeasurement).Select((fields, tags) => new { fields.height, tags.size }).Statement; select.Columns.ShouldNotBeEmpty(); select.ColumnNames().ShouldBe(new[] { nameof(Fields.height), nameof(Tags.size) }); }
public void Alias_field() { var testMeasurement = new TaggedMeasurement <Fields, Tags>("test"); var select = InfluxQuery.From(testMeasurement).Select(fields => new { HowHigh = fields.height }).Statement; select.ColumnNames().ShouldBe(new[] { nameof(Fields.height) }); select.Columns.Select(x => x.Alias).ShouldBe(new[] { "HowHigh" }); select.ToString().ShouldBe("SELECT height AS HowHigh FROM test"); }
public static From <TFields, TTags> From <TFields, TTags>(TaggedMeasurement <TFields, TTags> measurement) { return(new From <TFields, TTags>(measurement)); }