ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Node.js Driver API Reference Classes Encoder

Encoder¶

Encoder(protocolVersion, options)

Serializes and deserializes to and from a CQL type and a Javascript Type.

Constructor¶

new Encoder(protocolVersion, options)

Parameters:
Name Type Description
protocolVersion Number
options ClientOptions

Source

encoder.js, line 2129

Methods¶

decode(buffer, type)

Decodes Cassandra bytes into Javascript values.

This is part of an experimental API, this can be changed future releases.

Parameters:
Name Type Description
buffer Buffer

Raw buffer to be decoded.

type ColumnInfo

Source

encoder.js, line 2271

decodeRows(data, rowsNumber, columnNames, columnTypes) → {Array:.<Row:>}

Decodes a whole page of results.

Parameters:
Name Type Description
data Buffer
rowsNumber number
columnNames Array:.<string:>
columnTypes Array:.<{code:: number:}>

Source

encoder.js, line 2247

Returns:
Type
Array:.<Row:>

encode(value, typeInfoopt) → {Buffer|null|undefined}

Encodes Javascript types into Buffer according to the Cassandra protocol.

This is part of an experimental API, this can be changed future releases.

Parameters:
Name Type Attributes Description
value *

The value to be converted.

typeInfo Object | String | Number <optional>

The type information.

It can be either a:

  • A String representing the data type.
  • A Number with one of the values of dataTypes.
  • An Object containing the type.code as one of the values of dataTypes and type.info.

Source

encoder.js, line 2303

Throws:

When there is an encoding error

Type
TypeError
Returns:

Returns null for null values, undefined for unset values and buffer for all other values.

Type
Buffer | null | undefined

Was this page helpful?

PREVIOUS
Client
NEXT
EncoderMembers
  • Create an issue
  • Edit this page

On this page

  • Encoder
    • Constructor
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • main
    • main
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • concurrent
      • datastax
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metadata
        • Aggregate
        • ClientState
        • ColumnMetadata
        • Index
        • KeyspaceMetadata
        • MaterializedView
        • Metadata
        • SchemaFunction
        • Strategy
        • TableMetadata
        • UdtField
        • UserDefinedType
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • speculativeExecution
          • ConstantSpeculativeExecutionPolicy
          • NoSpeculativeExecutionPolicy
          • SpeculativeExecutionPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • Long
        • ResultSet
        • ResultStream
        • Row
        • TimeUuid
        • Vector
    • Classes
      • AddressResolver
      • ByteOrderedToken
      • Client
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • HashSet
      • Host
      • HostMap
      • LineString
      • Murmur3Token
      • Point
      • Polygon
      • PreparedInfo
      • RandomToken
      • SslOptions
      • Token
      • TokenRange
    • Interfaces
    • Events
    • Global Functions and Constants
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 14 May 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.2