https://github.com/scalajs-io/cassandra-driver
DataStax Node.js Driver for Apache Cassandra
https://github.com/scalajs-io/cassandra-driver
cassandra datastax-node-driver node nodejs npm npm-package scala scalajs
Last synced: 4 months ago
JSON representation
DataStax Node.js Driver for Apache Cassandra
- Host: GitHub
- URL: https://github.com/scalajs-io/cassandra-driver
- Owner: scalajs-io
- License: apache-2.0
- Created: 2017-02-05T11:26:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T23:07:32.000Z (about 6 years ago)
- Last Synced: 2025-01-17T22:42:49.944Z (5 months ago)
- Topics: cassandra, datastax-node-driver, node, nodejs, npm, npm-package, scala, scalajs
- Language: Scala
- Size: 28.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cassandra-driver API for Scala.js
=======================
[cassandra-driver](https://www.npmjs.com/package/cassandra-driver) - DataStax Node.js Driver for Apache Cassandra.### Description
A modern, feature-rich and highly tunable Node.js client library for Apache Cassandra (1.2+) and
DataStax Enterprise (3.1+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.### Build Dependencies
* [SBT v1.2.x](http://www.scala-sbt.org/download.html)
### Build/publish the SDK locally
```bash
$ sbt clean publish-local
```### Running the tests
Before running the tests the first time, you must ensure the npm packages are installed:
```bash
$ npm install
```Then you can run the tests:
```bash
$ sbt test
```### Examples
```scala
import io.scalajs.nodejs.console
import io.scalajs.npm.cassandradriver._
import scalajs.jsval client = new Client(new ClientOptions(contactPoints = js.Array("localhost"), keyspace = "classroom"))
val students = Seq(
js.Array("123456", "Larry Sanders", "Operating Systems")
)students foreach { params =>
client.execute("INSERT INTO students (id, name, course) VALUES (?, ?, ?)", params, (err, student) => {
console.log("student =>", student)
})
}class Student(val id: String, val name: String, val course: String) extends js.Object
```### Artifacts and Resolvers
To add the `CassandraDriver` binding to your project, add the following to your build.sbt:
```sbt
libraryDependencies += "io.scalajs.npm" %%% "cassandra-driver" % "0.5.0"
```Optionally, you may add the Sonatype Repository resolver:
```sbt
resolvers += Resolver.sonatypeRepo("releases")
```