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 FrameWriter
For AI agents: a documentation index is available at https://nodejs-rs-driver.docs.scylladb.com/v0.7.1/llms.txt. A Markdown version of this page is at https://nodejs-rs-driver.docs.scylladb.com/v0.7.1/api/FrameWriter.md.

FrameWriter¶

FrameWriter()

Encodes values into values frames, in the request frame layout: [u16 count], then for each value [i32 length][bytes]. Length -1 is null, and -2 is unset.

The writer reuses its buffer between frames. A frame is a view of that buffer, valid until the next frame of the same writer. Thus, pass a frame to Rust immediately. This is safe, because Rust copies the frame before the native call returns.

Callers must obey these rules. Otherwise, concurrent requests can send each other's values, with no error:

  • Do not await between writing a frame and passing it to Rust. Another request can write its own frame during the await.
  • Do not keep a frame after the native call returns. Copy it if you need it later, for example in a test.

In the driver, only RustSession uses a writer. Its structure enforces these rules. See its documentation.

A writer writes one frame at a time. A nested frame on the same writer throws, because it would overwrite the frame in progress.

Constructor¶

new FrameWriter()

Source

frame-writer.ts, line 42

Methods¶

batch(expectedTypes, params, encoder)

Encodes the params of all statements of a batch into one frame: [u16 statement count], then one params row per statement.

Parameters:
Name Type Description
expectedTypes

List of expected types, one list per statement.

params

Params, one array per statement.

encoder

Source

frame-writer.ts, line 74

Throws:

ArgumentError when there are more than 65,535 statements, or more than 65,535 params in one statement

Returns:

The frame, valid until the next frame of this writer.

buffers(values)

Writes values that are already encoded into one frame. null is written as null, and undefined as unset.

Parameters:
Name Type Description
values

Encoded values.

Source

frame-writer.ts, line 108

Throws:
  • TypeError when a value is not a Uint8Array, null or undefined

  • ArgumentError when there are more than 65,535 values

Returns:

The frame, valid until the next frame of this writer.

params(expectedTypes, params, encoder)

Encodes all params of a statement into one frame.

Parameters:
Name Type Description
expectedTypes

List of expected types.

params
encoder

Source

frame-writer.ts, line 54

Throws:

ArgumentError when there are more than 65,535 params

Returns:

The frame, valid until the next frame of this writer.

Was this page helpful?

PREVIOUS
FrameReader
NEXT
GraphResultSet
  • Create an issue
  • Edit this page

On this page

  • FrameWriter
    • Constructor
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • v0.7.1
    • main
    • v0.7.1
    • v0.6.1
  • Getting Started
  • Statements
    • Executing CQL Statements - Best Practices
    • Unprepared Statements
    • Batch Statements
    • Parameterized queries
  • Fetching Large Result Sets
  • Schema Metadata
  • Topology
  • Replicas
  • Query Tracing
  • Logging
  • Policies
    • Load Balancing
    • Retry Policies
  • Authentication
  • Client Routes (Private Networking)
  • Shutdown
  • Migration Guide
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • datastax
        • graph
        • search
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • BigDecimal
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • ResultStream
        • Row
        • TimeUuid
        • Tuple
        • Uuid
    • Classes
      • Client
      • ColumnInfo
      • ConstantSpeculativeExecutionPolicy
      • DateRange
      • DateRangeBound
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
      • Edge
      • Element
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • FrameWriter
      • GraphResultSet
      • HashSet
      • LineString
      • NoSpeculativeExecutionPolicy
      • Path
      • Point
      • Polygon
      • PreparedInfo
      • Property
      • ResultColumnsCache
      • ResultSet
      • RustResult
      • RustSession
      • SpeculativeExecutionPolicy
      • SslOptions
      • Token
      • TokenRange
      • Vertex
      • VertexProperty
      • module-metadata-LocalStrategy
    • 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 23 Oct 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.3