How to use the express-cassandra.createClient function in express-cassandra

To help you get started, we’ve selected a few express-cassandra examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathersjs / generator-feathers / generators / connection / templates / js / cassandra.js View on Github external
module.exports = function (app) {
  const connectionInfo = app.get('<%= database %>');
  const models = ExpressCassandra.createClient(connectionInfo);
  const cassandraClient = models.orm.get_system_client();

  app.set('models', models);

  cassandraClient.connect(err => {
    if (err) throw err;

    const cassanknex = require('cassanknex')({ connection: cassandraClient });

    FeathersCassandra.cassanknex(cassanknex);

    cassanknex.on('ready', err => {
      if (err) throw err;
    });

    app.set('cassanknex', cassanknex);
github feathersjs / generator-feathers / generators / connection / templates / ts / cassandra.ts View on Github external
export default function (app: Application) {
  const connectionInfo = app.get('<%= database %>');
  const models = ExpressCassandra.createClient(connectionInfo);
  const cassandraClient = models.orm.get_system_client();

  app.set('models', models);

  cassandraClient.connect((err: any) => {
    if (err) throw err;

    const cassanknex = require('cassanknex')({ connection: cassandraClient });

    FeathersCassandra.cassanknex(cassanknex);

    cassanknex.on('ready', (err: any) => {
      if (err) throw err;
    });

    app.set('cassanknex', cassanknex);

express-cassandra

Cassandra Object Models (ORM/ODM/OGM) for NodeJS with support for Apache Cassandra, ScyllaDB, Datastax Enterprise, Elassandra & JanusGraph.

LGPL-3.0
Latest version published 3 months ago

Package Health Score

70 / 100
Full package analysis