ReadonlybinaryThe binary input format. One of: "BASE64", "HEX", "UTF-8".
ReadonlychannelThe channel name (always "ELASTIC").
ReadonlydbThe database name.
ReadonlyisWhether the channel is closed (because the client was closed).
ReadonlypipeThe pipe name.
ReadonlyschemaThe schema name.
Append a single row into the elastic channel without waiting for the
acknowledgement (fire-and-forget). The append is still registered for the
error handler, so an asynchronous failure is reported through
setErrorHandler (keyed by appendToken), just not through a promise. Use
appendRowWithWait when you need one to await.
Row data as column-name to value pairs
Required caller-supplied opaque id for this append, handed
to the setErrorHandler handler on asynchronous failure, or to the
setSuccessHandler handler on acknowledgement. Not sent to Snowflake; any
value (including "") is valid. The argument is mandatory: pass null
explicitly to leave the append untracked for both handlers. The token is
retained in memory until the append is acknowledged, so a large object raises
the memory footprint of in-flight appends — prefer a small value.
Append multiple rows into the elastic channel without waiting for the
acknowledgement (fire-and-forget). The append is still registered for the
error handler, so an asynchronous failure is reported through
setErrorHandler (keyed by appendToken), just not through a promise. Use
appendRowsWithWait when you need one to await.
Array of row objects (column-name to value pairs)
Required caller-supplied opaque id for this batch, handed
to the setErrorHandler handler on asynchronous failure, or to the
setSuccessHandler handler on acknowledgement. Not sent to Snowflake; any
value (including "") is valid. The argument is mandatory: pass null
explicitly to leave the append untracked for both handlers. The token is
retained in memory until the append is acknowledged, so a large object raises
the memory footprint of in-flight appends — prefer a small value.
Append multiple rows into the elastic channel. The returned promise resolves when Snowflake acknowledges the batch. If an error handler is registered it also fires on an asynchronous failure — dual delivery.
Array of row objects (column-name to value pairs)
Required caller-supplied opaque id for this batch, handed
to the setErrorHandler handler on asynchronous failure, or to the
setSuccessHandler handler on acknowledgement. Not sent to Snowflake; any
value (including "") is valid. The argument is mandatory: pass null
explicitly to leave the append untracked for both handlers. The token is
retained in memory until the append is acknowledged, so a large object raises
the memory footprint of in-flight appends — prefer a small value.
Append a single row into the elastic channel. The returned promise resolves when Snowflake acknowledges the row. If an error handler is registered it also fires on an asynchronous failure — dual delivery.
Row data as column-name to value pairs
Required caller-supplied opaque id for this append, handed
to the setErrorHandler handler on asynchronous failure, or to the
setSuccessHandler handler on acknowledgement. Not sent to Snowflake; any
value (including "") is valid. The argument is mandatory: pass null
explicitly to leave the append untracked for both handlers. The token is
retained in memory until the append is acknowledged, so a large object raises
the memory footprint of in-flight appends — prefer a small value.
Get the current status of this channel.
Register (or replace) a handler invoked when appends fail asynchronously,
i.e. after the append call already returned. Fires once per failure event
with a single ErrorDetail bundling the appendTokens that failed
together (a server-ack batch, or every in-flight append on invalidation) and
their common error, so callers need not await each promise. Both append
flavours are covered: it is the only failure signal for the fire-and-forget
ones, and an additional one for the WithWait ones, whose promise still
rejects. Only appends given an appendToken appear, and tokens are opaque and
not deduplicated. Synchronous failures (closed channel, serialization, bad
arguments) throw from the append call and never reach the handler. A handler
that throws is caught and logged.
Called with one ErrorDetail per failure event
TypeError If handler is not a function, or declares more than one parameter (it is called with a single ErrorDetail)
Register (or replace) a handler invoked when appends are acknowledged by
Snowflake. Fires once per successful ack batch with a single
SuccessDetail bundling the appendTokens acknowledged together, so
callers need not await each promise. Both append flavours are covered: it is
the only success signal for the fire-and-forget ones, and an additional one for
the WithWait ones, whose promise still resolves. Purely opt-in — without a
registered handler nothing is collected. Only appends given an appendToken
appear, and tokens are opaque and not deduplicated. A handler that throws is
caught and logged.
Like the error handler, this runs on the acknowledgement path, so a slow handler delays subsequent acknowledgements — keep it short.
Called with one SuccessDetail per successful ack batch
TypeError If handler is not a function, or declares more than one parameter (it is called with a single SuccessDetail)
Wait for all buffered data in this channel to be flushed to Snowflake.
Optionaloptions: { timeoutMs?: number }Wait options
OptionaltimeoutMs?: numberOptional timeout in milliseconds.
An elastic channel for streaming data into a Snowflake table.
Unlike a regular channel, an elastic channel has no offset tokens and its lifecycle is tied to the client — there is no close method, and the same instance is returned on repeated calls to
client.getElasticChannel(). Appends come in two flavours: fire-and-forgetappendRow/appendRowsreturn nothing, whileappendRowWithWait/appendRowsWithWaitreturn a promise that resolves when Snowflake acknowledges the rows. Every append must carry an opaqueappendToken— required, but nullable — handed back to the handler registered viasetErrorHandlerwhen that append fails asynchronously, or tosetSuccessHandlerwhen it is acknowledged; passnullto opt that append out of both handlers.Create instances using
client.getElasticChannel().