Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: DataStax Node.js Driver
summary: DataStax Node.js Driver for Apache Cassandra
theme: datastax
swiftype_drivers: nodejsdrivers
homepage: https://docs.datastax.com/en/developer/nodejs-driver
sections:
- title: Features
prefix: /features
Expand Down Expand Up @@ -37,8 +38,10 @@ links:
- title: Npm
href: https://www.npmjs.org/package/cassandra-driver
versions:
- name: '4.7'
- name: '4.8'
ref: 'master'
- name: '4.7'
ref: 'v4.7.2'
- name: '4.6'
ref: 'v4.6.4'
- name: '4.5'
Expand Down
21 changes: 0 additions & 21 deletions lib/encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,10 @@ const zeroLengthTypesSupported = new Set([
dataTypes.blob
]);

/**
* @typedef {(singleTypeNames[keyof singleTypeNames] | types.dataTypes.duration | types.dataTypes.text)} SingleTypeCodes
* @typedef {('point' | 'polygon' | 'duration' | 'lineString' | 'dateRange')} CustomSimpleTypeCodes
* @typedef {(customTypeNames[CustomSimpleTypeCodes]) | CustomSimpleTypeCodes | 'empty'} CustomSimpleTypeNames
* @typedef {{code : SingleTypeCodes, info?: null, options? : {frozen?:boolean, reversed?:boolean} }} SingleColumnInfo
* @typedef {{code : (types.dataTypes.custom), info : CustomSimpleTypeNames, options? : {frozen?:boolean, reversed?:boolean}}} CustomSimpleColumnInfo
* @typedef {{code : (types.dataTypes.map), info : [ColumnInfo, ColumnInfo], options?: {frozen?: Boolean, reversed?: Boolean}}} MapColumnInfo
* @typedef {{code : (types.dataTypes.tuple), info : Array<ColumnInfo>, options?: {frozen?: Boolean, reversed?: Boolean}}} TupleColumnInfo
* @typedef {{code : (types.dataTypes.tuple | types.dataTypes.list)}} TupleListColumnInfoWithoutSubtype TODO: guessDataType can return null on tuple/list info, why?
* @typedef {{code : (types.dataTypes.list | types.dataTypes.set), info : ColumnInfo, options?: {frozen?: Boolean, reversed?: Boolean}}} ListSetColumnInfo
* @typedef {{code : (types.dataTypes.udt), info : {name : string, fields : Array<{name : string, type : ColumnInfo}>}, options? : {frozen?: Boolean, reversed?: Boolean}}} UdtColumnInfo
* @typedef {{code : (types.dataTypes.custom), customTypeName : ('vector'), info : [ColumnInfo, number], options? : {frozen?:boolean, reversed?:boolean}}} VectorColumnInfo
* @typedef {{code : (types.dataTypes.custom), info : string, options? : {frozen?:boolean, reversed?:boolean}}} OtherCustomColumnInfo
* @typedef {SingleColumnInfo | CustomSimpleColumnInfo | MapColumnInfo | TupleColumnInfo | ListSetColumnInfo | VectorColumnInfo | OtherCustomColumnInfo | UdtColumnInfo | TupleListColumnInfoWithoutSubtype} ColumnInfo If this is a simple type, info is null; if this is a collection type with a simple subtype, info is a string, if this is a nested collection type, info is a ColumnInfo object
*/

/**
* Serializes and deserializes to and from a CQL type and a Javascript Type.
* @param {Number} protocolVersion
* @param {import('./client.js').ClientOptions} options
* @constructor
*/
function Encoder(protocolVersion, options) {
Expand Down Expand Up @@ -212,7 +196,6 @@ function defineInstanceMembers() {
*
* @param {Buffer} bytes
* @param {OtherCustomColumnInfo | VectorColumnInfo} columnInfo
* @returns
*/
this.decodeCustom = function (bytes, columnInfo) {

Expand Down Expand Up @@ -750,7 +733,6 @@ function defineInstanceMembers() {
*
* @param {any} value
* @param {OtherCustomColumnInfo | VectorColumnInfo} columnInfo
* @returns
*/
this.encodeCustom = function (value, columnInfo) {

Expand Down Expand Up @@ -908,7 +890,6 @@ function defineInstanceMembers() {
*
* @param {any} value
* @param {UdtColumnInfo} columnInfo
* @returns
*/
this.encodeUdt = function (value, columnInfo) {
const udtInfo = columnInfo.info;
Expand Down Expand Up @@ -939,7 +920,6 @@ function defineInstanceMembers() {
*
* @param {any} value
* @param {TupleColumnInfo} columnInfo
* @returns
*/
this.encodeTuple = function (value, columnInfo) {
const tupleInfo = columnInfo.info;
Expand Down Expand Up @@ -1105,7 +1085,6 @@ function defineInstanceMembers() {
/**
* If not provided, it uses the array of buffers or the parameters and hints to build the routingKey
* @param {Array} params
* @param {import('..').ExecutionOptions} execOptions
* @param [keys] parameter keys and positions in the params array
* @throws TypeError
* @internal
Expand Down
2 changes: 0 additions & 2 deletions lib/types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ const dataTypes = {
/**
* Returns the typeInfo of a given type name
* @param {string} name
* @returns {import('../encoder').ColumnInfo}
*/
getByName: function(name) {
name = name.toLowerCase();
Expand Down Expand Up @@ -416,7 +415,6 @@ function uuid(options, buffer, offset) {
* @internal
* @ignore
* @throws {ArgumentError}
* @param {import('../encoder').ColumnInfo} item
*/
function getDataTypeNameByCode(item) {
if (!item || typeof item.code !== 'number') {
Expand Down
11 changes: 2 additions & 9 deletions lib/types/vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
*/
"use strict";
/** @module types */
/**
* Creates a new instance of Cql Vector, also compatible with Float32Array.
* @class
*/

const util = require('node:util');
class Vector {
/**
Expand Down Expand Up @@ -98,16 +95,12 @@ class Vector {
return Vector;
}

/**
*
* @param {(value: any, index: number, array: any[]) => void} callback
*/
forEach(callback) {
return this.elements.forEach(callback);
}

/**
* @returns {string | undefined} get the subtype string, e.g., "float", but it's optional so it can return null
* @returns {string | undefined} get the subtype string, e.g., "float", but it's optional so it can return undefined
*/
getSubtype(){
return this.subtype;
Expand Down