This content originally appeared on DEV Community and was authored by Raksix
I made a cassandra driver but easier than cassandra-driver
Souce Code: Click Me!
Npmjs Page: Click Me!
if you want usage execute:
connection.client.execute("SELECT * FROM ")
İf you find a bug/issue please report Report/Issue Link
Simple Usage:
const cassandra = require("raksix-cassandra")
// connect config payload
const config = {
secure_path: "./secure-zip-path",
client_id: "client_id",
client_secret: "client_secret",
keyspace: "keyspace"
}
// connect cassandra-driver
const connection = cassandra.connect(config.secure_path, config.client_id, config.client_secret, config.keyspace)
// table payload
const data2 = {
id: "text PRIMARY KEY",
name: "text",
email: "text",
password: "text"
}
// create table method
connection.create_table("test", data2)
// insert payload
const data3 = {
id: "1",
name: "furkan",
email: "furkan@gmail.com",
password: "1234"
}
// insert method
connection.instert("test", data3)
// find method
connection.find("test", { name: "furkan" }).then(rs => {
// result
console.log(rs.rows)
})
// find all
connection.find_all("test").then(rs => {
// result
console.log(rs.rows)
})
// update method
connection.update("test", { name: "furkan" }, { email: "raksix@raksix.wtf", password: "12346" })
This content originally appeared on DEV Community and was authored by Raksix
Raksix | Sciencx (2021-05-13T14:46:41+00:00) Easy Cassandra Driver. Retrieved from https://www.scien.cx/2021/05/13/easy-cassandra-driver/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.