4.0.0 • Published 5 years ago

caluxyr v4.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Caluxyr

version types publish size license

A type-safe query builder for Cassandra.

Installation

This package is a tiny wrapper around the DataStax Node.js Driver.

# cassandra-driver is a required peer-dependency.
npm install caluxyr cassandra-driver

Usage

import { Client } from 'caluxyr'

const db = new Client({
  contactPoints: ['localhost'],
  localDataCenter: 'datacenter1',
  keyspace: 'MyApp',
})

// Example 1: Selects.
const [user] = await db.select<User>('UserByEmail', {
  where: {
    email: 'hello@example.com',
    verified: true,
  },
  filtering: true,
})

// Example 2: Inserts.
await db.insert<User>('User', {
  data: {
    userId: '794278747242106880',
  },
})

// Example 3: Updates.
await db.update<User>('User', {
  data: {
    verified: false,
  },
  where: {
    userId: '794278747242106880',
  },
})

// Example 4: Deletes.
await db.remove<User>('User', {
  where: {
    userId: '794278747242106880',
  },
})
4.0.0

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago