{"id":22568510,"url":"https://github.com/expressots/scylladb-driver-old","last_synced_at":"2025-10-24T18:06:54.811Z","repository":{"id":152622488,"uuid":"626184631","full_name":"expressots/scylladb-driver-old","owner":"expressots","description":"The ScyllaDB driver for Node.js written in C++ 🚀","archived":false,"fork":false,"pushed_at":"2023-05-15T22:39:35.000Z","size":204,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-03T09:21:30.172Z","etag":null,"topics":["nodejs","scylladb","scylladb-driver"],"latest_commit_sha":null,"homepage":"https://www.scylladb.com/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/expressots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-11T01:06:07.000Z","updated_at":"2024-03-03T22:53:23.000Z","dependencies_parsed_at":"2023-08-18T17:32:52.437Z","dependency_job_id":null,"html_url":"https://github.com/expressots/scylladb-driver-old","commit_stats":null,"previous_names":["expressots/scylladb-driver"],"tags_count":0,"template":false,"template_full_name":"expressots/nodepp-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressots%2Fscylladb-driver-old","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressots%2Fscylladb-driver-old/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressots%2Fscylladb-driver-old/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressots%2Fscylladb-driver-old/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/expressots","download_url":"https://codeload.github.com/expressots/scylladb-driver-old/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704578,"owners_count":20982299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","scylladb","scylladb-driver"],"created_at":"2024-12-08T00:13:31.637Z","updated_at":"2025-10-24T18:06:49.763Z","avatar_url":"https://github.com/expressots.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e ScyllaDB Driver \u003c/h1\u003e\n\n\u003e The native ScyllaDB Driver wrapper made by @ExpressoTS Team for the Node.js community ❤🚀.\n\n# Getting Started\n\nFirst, make sure you have the driver properly [installed](https://github.com/expressots/scylladb-driver/...).\n\n## Connecting to a Cluster\n\nBefore we can start executing any queries against a Cassandra cluster we need to setup \nan instance of Cluster. As the name suggests, you will typically have one instance of \nCluster for each Cassandra cluster you want to interact with.\n\n### Connecting to Cassandra\n\nThe simplest way to create a Cluster is like this:\n\n```ts\nimport { Cluster } from \"scylladb-driver\"\n\nconst cluster = new Cluster();\n```\n\nThis will attempt to connection to a Cassandra instance on your local machine (127.0.0.1).\nYou can also specify a list of IP addresses for nodes in your cluster:\n\n```ts\nimport { Cluster } from \"scylladb-driver\"\n\nconst cluster = new Cluster({\n  nodes: [\"192.168.0.1\", \"192.168.0.2\"]\n});\n```\n\nThe set of IP addresses we pass to the `Cluster` is simply an initial set of contact points. \nAfter the driver connects to one of these nodes it will _automatically_ discover the rest of the \nnodes in the cluster and connect to them, so you don’t need to list every node in your cluster.\n\nIf you need to use a non-standard port, use SSL, or customize the driver’s behavior in some other way, this is the place to do it:\n\n```ts\nimport { Cluster } from \"scylladb-driver\"\n\nconst cluster = new Cluster({\n  nodes: [\"192.168.0.1\", \"192.168.0.2\"],\n  port: 1234,\n  sslContext: // TODO: Understand what would this be.\n});\n```\n\nInstantiating a `Cluster` does **not** actually connect us to any nodes. \nTo establish connections and begin executing queries we need a `Session`, which is created by \ncalling the `connect()` method from the `Cluster` class.\n\n```ts\nimport { Cluster } from \"scylladb-driver\"\n\nconst cluster = new Cluster();\nconst session = cluster.connect();\n```\n\n## Session keyspace\n\nThe `connect()` method takes an optional `keyspace` argument which sets the default keyspace \nfor all queries made through that `Session`:\n\n```ts\nimport { Cluster } from \"scylladb-driver\"\n\nconst cluster = new Cluster();\nconst session = cluster.connect(\"keyspace\");\n```\n\nYou can always change a `Session`’s `keyspace` using `setKeyspace()` or by executing a `USE \u003ckeyspace\u003e` query:\n\n```ts\nconst keyspace = \"keyspace\"\nsession.setKeyspace(keyspace);\n// Or you can do this instead\nsession.query(`USE ${keyspace}`);\n```\n\n## Executing Queries\n\nNow that we have a `Session` we can begin to execute queries. The simplest way to execute a query is to use `execute()`:\n\n```ts\ntype UserTable = {\n  name: string;\n  age: number;\n  email: string;\n};\n\nconst rows: UserTable = session.execute(\"SELECT name, age, email FROM users\");\nrows.forEach(({ name, age, email }) =\u003e {\n  console.log(`${name}, ${age}, ${email}`);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressots%2Fscylladb-driver-old","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpressots%2Fscylladb-driver-old","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressots%2Fscylladb-driver-old/lists"}