Skip to content

Add VECTOR and BSON data types support#16

Open
okramarenko wants to merge 5 commits intoadd10supportfrom
add_vector
Open

Add VECTOR and BSON data types support#16
okramarenko wants to merge 5 commits intoadd10supportfrom
add_vector

Conversation

@okramarenko
Copy link
Copy Markdown
Collaborator

@okramarenko okramarenko commented Apr 28, 2026

Note

Medium Risk
Medium risk because it changes low-level protocol metadata parsing, type mapping, and parameter serialization, which can affect result reading/writing across many queries. Also introduces a new session-setting toggle gated by server version that could break connections if misconfigured.

Overview
Adds opt-in support for SingleStore extended data types by introducing EnableExtendedDataTypes (connection string + settings) that enables enable_extended_types_metadata during connection open and after connection reset (requires SingleStore >= 8.5.28).

Extends column definition parsing with SingleStore-specific extended metadata (SingleStoreExtendedTypeCode, VECTOR dimensions/element type) and updates type mapping/metadata so BSON/VECTOR surface as SingleStoreDbType.Bson/SingleStoreDbType.Vector while still transporting as BLOB in the wire protocol.

Implements typed VECTOR value reading (new Vector*ColumnReaders returning ReadOnlyMemory<T> with length/endianness validation), adjusts row byte access rules for VECTOR vs BSON, and adds BSON/VECTOR parameter serialization (binary literal for text mode; length-encoded bytes for binary/prepared mode) for common input types.

Reviewed by Cursor Bugbot for commit d0af192. Bugbot is set up for automated code reviews on this repo. Configure here.

private string? m_physicalName;

public bool IsBson => ExtendedTypeCode == SingleStoreExtendedTypeCode.Bson;
public bool IsVector => ExtendedTypeCode == SingleStoreExtendedTypeCode.Vector;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused IsBson and IsVector properties are dead code

Low Severity

The newly added IsBson and IsVector properties on ColumnDefinitionPayload are never referenced anywhere in the codebase. A grep confirms the only matches are their definitions. All other code that needs to check the extended type uses ExtendedTypeCode directly (e.g., the switch in ColumnReader.Create). These are dead code on an internal class with no consumers.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8716569. Configure here.

Comment thread src/SingleStoreConnector/Core/TypeMapper.cs Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d0af192. Configure here.


outputSpan[index++] = quote;
writer.Advance(index);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WriteBinaryLiteral duplicates inline binary escaping logic

Medium Severity

The new WriteBinaryLiteral method contains identical binary-literal escaping logic to the inline code in AppendSqlString (the byte[]/float[] branch). This security-sensitive SQL escaping logic now exists in two places, meaning a bug fix in one copy could be missed in the other. The existing inline code could call WriteBinaryLiteral instead.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d0af192. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant