Was this page helpful?
Caution
You're viewing documentation for an unstable version of ScyllaDB Node.js Driver. Switch to the latest stable version.
ResultColumnsCache¶
ResultColumnsCache()
Converted result columns of one prepared statement handle.
Goal: cache the converted result metadata (column names and types) on the JS side. Converting it from Rust to JS takes many N-API calls per column. Without the cache, this conversion runs for each result. With it, it runs only when the result metadata of the prepared statement changes.
Rust tags each result of the handle with a metadata generation. The same generation means the same column names and types, so the converted columns are reused until the generation changes.
Constructor¶
new ResultColumnsCache()
Methods¶
get()
Returns the columns of the result, converting them only when the generation changes.