Skip to content

Instantly share code, notes, and snippets.

View beccam's full-sized avatar

Rebecca Mills beccam

View GitHub Profile
@beccam
beccam / astra-connect.js
Last active August 6, 2020 17:31
Connect to Astra with the DataStax Node.js driver
const cassandra = require('cassandra-driver');
const client = new cassandra.Client({
cloud: { secureConnectBundle: 'path/to/secure-connect-DATABASE_NAME.zip' },
credentials: { username: 'username', password: 'password' }
keyspace: 'demo'
});
function createTable(){
@beccam
beccam / AstraConnect.cs
Last active August 6, 2020 14:09
Connect to Astra with the DataStax C# driver
using Cassandra;
using System.Linq;
using System;
namespace QuickStart
{
class AstraConnect
{
static void Main(string[] args)
{
@beccam
beccam / AstraConnect.java
Last active August 6, 2020 17:30
Connect to Astra with the DataStax Java driver
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.*;
import java.nio.file.Paths;
public class AstraConnect {
public static void main(String[] args) {
// TO DO: Fill in your own host, port, and data center