Giter VIP home page Giter VIP logo

qlik-sse's Introduction

qlik-sse

Continuing from where Miralem left off. The original repository can be found here

@informatiqal/qlik-sse is an npm package that simplifies the creation of Qlik Server Side Extensions in nodejs.

Check out Server Side Extension for more info and how to get started from the Qlik side.

Breaking change

After migrating to grpc-js and protobuf.js there is a small (but breaking) change when creating instance of a message. Instead of .buffer property we now have to call .finish() method.

//Old syntax
const tableDescription = q.sse.TableDescription.encode({
  fields: [
    { name: "Dim", dataType: q.sse.DataType.STRING },
    { name: "Value", dataType: q.sse.DataType.NUMERIC },
  ],
}).buffer;
//New syntax
const tableDescription = q.sse.TableDescription.encode({
  fields: [
    { name: "Dim", dataType: q.sse.DataType.STRING },
    { name: "Value", dataType: q.sse.DataType.NUMERIC },
  ],
}).finish();


Getting started

Prerequisites

Before continuing, make sure you:

  • have Node.js >= v8.0.0 installed
  • can configure your Qlik installation

Usage

Start by installing @informatiqal/qlik-sse:

npm install @informatiqal/qlik-sse

Next, create a file foo.js:

import * as q from "@informatiqal/qlik-sse";
//or import { server, sse, sseServices } from "@informatiqal/qlik-sse";

// create an instance of the server
const s = q.server({
  identifier: "xxx",
  version: "0.1.0",
});

// register functions
s.addFunction(/* */);

// start the server
s.start({
  port: 50051,
  allowScript: true,
});

and then run it to start the SSE plugin server:

node foo.js

Configure the SSE in your Qlik installation by following these instructions

If you're running Qlik Sense Desktop (or Qlik Engine) locally, restart it after starting the SSE server to allow Qlik Engine to get the SSE plugin's capabilities.

Assuming you have named the plugin sse, you should now be able to use it's script functions in expressions:

sse.ScriptEval('return Math.random()*args[0]', sum(Sales));

You have now successfully created a Server Side Extension that can be used from within Qlik Sense or Qlik Core.

Take a look at some of the examples on how to add functionality to the SSE.

Events

The package expose event emitter that emits couple of events - info and error

import { server, emitter } from "@informatiqal/qlik-sse";

const s = server({
  identifier: "MySSE",
  version: "0.1.0",
});

emitter.on("info", (message) => {
  // do something with the info message
});

emitter.on("error", (message) => {
  // do something in case of error
});

TODO

  • Documentation
    • API
    • Explain function types SCALAR, AGGREGATION and TENSOR
    • Table load
    • Documentation review + dedicated help/documentation page
  • Examples
    • How to use tensorflow with qix data
    • Real use cases
      • linear regression
      • k-means
      • ...
    • Full Qlik example
      • configuring Qlik Engine to use SSEPlugin
      • dockerized environment
      • loading data
      • expression calls
  • Features
    • Script evaluation
    • SSL communication (certificate usage)
    • Error handling
  • Code
    • Convert to ES6
    • Convert to TypeScript? Just used JSDoc. No need to complicate things
    • Build step

qlik-sse's People

Contributors

countnazgul avatar miralemd avatar renovate[bot] avatar

Stargazers

 avatar

qlik-sse's Issues

Emit events?

Instead of logging the messages directly in the console the package should have a way to pass the messages instead.

Is using Events the best option here?

Update the examples

The original repo comes with couple of examples. Lets make sure that they are updated

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency enigma.js to v2.14.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @grpc/grpc-js ^1.9.2
  • @grpc/proto-loader ^0.7.9
  • protobufjs ^7.2.5
  • @rollup/plugin-node-resolve ^15.2.1
  • enigma.js ^2.12.0
  • rollup ^3.29.1
  • rollup-plugin-delete ^2.0.0
  • typescript ^5.2.2
  • vitest ^0.34.4
  • ws ^8.14.1

  • Check this box to trigger a request for Renovate to run again on this repository

Manage services?

Is there any point of managing services on the fly?

For example: delete service, disable service (service is there but it will return error when accessing it).

This question is valid if there will be some tool/ul on top to manage the services

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.