@vladimir-nussem/abis-lazy-cube
v0.1.2
Published
Lazy loading OLAP CUBE
Downloads
7
Readme
Description
Lazy Loading Olap CUBE that loads as the user requests the combination of dimensions/measures
Installation
npm install --save @vladimir-nussem/abis-lazy-cube
Running the app
.env -- for postgres
DB_TYPE=postgres
DB_NAME=cube
DB_USER_NAME=u0
DB_PASSWORD=
DB_HOST=localhost
DB_PORT=5432
DB_SYNCHRONIZE=true -- creates cube tables on startup
DB_LOGGING=true
.env -- for oracle (< 11)
DB_TYPE=oracle
DB_USER_NAME=<user name>
DB_PASSWORD=<password>
DB_HOST=localhost
DB_PORT=5432
DB_CONNECTION_STRING=
DB_SYNCHRONIZE=false -- does not work for oracle :( -- wip
DB_LOGGING=true
app.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { LazyOlapModule, LazyQueryService, LazyQueryModule } from "@vladimir-nussem/abis-lazy-cube";
@Module({
imports: [
LazyOlapModule,
LazyQueryModule
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
app.controller
import { Body, Controller, Get, Put } from '@nestjs/common';
import { LazyQueryService } from "@vladimir-nussem/abis-lazy-cube";
@Controller()
export class AppController {
constructor(
private queryService: LazyQueryService
) {}
@Post()
query(@Body() body) {
this.queryService.query(body.dimentions, body.measures, body.tableName, body.tableAlias, body.cubeName, body.where);
}
}
http request
POST http://localhost:3000
Content-Type: application/json
{
"cubeName": "<name>",
"tableName": "<table name>",
"tableAlias": "<table alias>",
"where": "optional sql where prefilter condition",
"dimensions": [
{
"alias": "dimension name",
"name": "<column name>",
"values": [value1, value2],
"aggregate": boolean
},
{
"alias": "name of resulted column",
"name": "table_field",
"values": [value1, value2],
"aggregate": boolean
"ignore": optional boolean
}
],
"measures": [
{
"alias": "measured name",
"value": "aggregate function on column sum(table_field), count(*)"
},
{
"alias": "measured name",
"value": "aggregate function on column sum(table_field), count(*)"
}
]
}
Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
Stay in touch
- Author - Vladimir Nussem ([email protected])
- Website - [https://armchairsoftware.ro]
License
Nest is MIT licensed.