-
Notifications
You must be signed in to change notification settings - Fork 3
Getting Started
To start using FluentOlap, create a class that inherits from the Analytical Object.
This initializes some sane defaults for the denormalized Type Map, which is the end result of using the Analytical object.
public class SomeClass {
public int x {get; set;}
public int y {get; set;}
}
public class SomeClassAnalyzer : AnalyticalObject<SomeClass> {}Creating an instance of this class will give the ability to retrieve its type map.
SomeClassAnalyzer analyzer = new SomeClassAnalyzer();
TypeMap map = analyzer.TypeMap;As mentioned in its documentation, the type map will contain the denormalized model.
Furthermore, you can populate (retrieve data) using the same analyzer object and defining a service.
analyzer.ServiceName = "SomeClassService";
FluentOlapConfiguration.ServiceDefinitions = new ServiceDefinitions {
// Note, you can use template urls in the HttpService, covered in the service section
["SomeClassService"] = new HttpService("https://url.xyz/api/{name}"),
}
PopulationResult result = analyzer.PopulateAsync(new HttpServiceOptions {
Parameters = { // Note, parameters is of type object, so any properties will work.
name = "foo"
}
})The Population Result can then be used as if it is a Dictionary<string, object>. Different
modules of FulentOlap may be used to load it into a database and the like. But as for the core,
this is the end result of the population process.
You can use the PopulationResult to also insert the data into the database using the Ingester plugin, the ingester requires a database provider.
// Creating an instance of the ingester requires a database provider.
DataIngester ingester = new DataIngester(new MariaDbProvider(MariaDbTableEngine.InnoDB, new Dictionary<InternalType, string>()
{
[InternalType.STRING] = "TEXT",
[InternalType.INTEGER] = "BIGINT",
[InternalType.FLOAT] = "FLOAT",
[InternalType.BOOLEAN] = "BOOLEAN",
[InternalType.DATETIME] = "DATETIME"
}));
// This will handle creating the table if it does not exist, updating it if it has changed and
// Database insertion
await ingester.InsertIntoDb(result);FluentOlap is still growing and will continue to become more stable over time.