0.1.2 • Published 2 months ago

@vladimir-nussem/abis-lazy-cube v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

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

License

Nest is MIT licensed.

0.1.2

2 months ago

0.1.1

2 months ago

0.1.0

2 months ago

0.0.23

2 months ago

0.0.22

2 months ago

0.0.21

2 months ago

0.0.20

2 months ago

0.0.19

2 months ago

0.0.18

2 months ago

0.0.17

2 months ago

0.0.16

2 months ago

0.0.15

3 months ago

0.0.13

3 months ago

0.0.12

3 months ago

0.0.11

3 months ago

0.0.10

3 months ago

0.0.9

3 months ago

0.0.8

3 months ago

0.0.7

3 months ago

0.0.6

3 months ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago