latitude-dev/latitude

Can we configure Cassandra as data source?

navyademo1 opened this issue · 6 comments

Hi,

I have a query, can we connect to Cassandra data source, if not

  1. Can we expect in near future?
  2. Is there a way to implement custom connector for this?

Is there a way to implement custom connector for this?

Yes, never worked with Casandra. But maybe using under the hood something like this package https://github.com/datastax/nodejs-driver and implementing the methods in BaseConnector

Any connector in connectors folder can serve as example:
https://github.com/latitude-dev/latitude/tree/main/packages/connectors

We might implement ourselves I'll keep the issue open.

Got it, thanks for the update.

Hi @andresgutgon , I just need to add this basic logic in BaseConnector?

const cassandra = require('cassandra-driver');

const client = new cassandra.Client({
contactPoints: ['h1', 'h2'],
localDataCenter: 'datacenter1',
keyspace: 'ks1'
});

const query = 'SELECT name, email FROM users WHERE key = ?';

client.execute(query, [ 'someone' ])
.then(result => console.log('User with email %s', result.rows[0].email));

am new to the JavaScript basically from Java background.

Can you please share which will be the landing file of the latitude project when we trigger the endpoint from react app..?

This issue is stale because it has been open for 30 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.