Skip to content

Conversation

@fresh-borzoni
Copy link
Contributor

@fresh-borzoni fresh-borzoni commented Feb 10, 2026

Summary

closes #293

  • Align CPP Table API with Java/Rust builder pattern
  • Rename Connection::Connect to Connection::Create to align with Java's createConnection

API changes

Connection

Connection::Connect(addr, conn) -> Connection::Create(addr, conn)

Append

table.NewAppendWriter(writer) -> table.NewAppend().CreateWriter(writer)

Upsert

table.NewUpsertWriter(writer)-> table.NewUpsert().CreateWriter(writer)
table.NewUpsertWriter(writer, names) -> table.NewUpsert().PartialUpdateByName(names).CreateWriter(writer)
table.NewUpsertWriter(writer, indices) -> table.NewUpsert().PartialUpdateByIndex(indices).CreateWriter(writer)

Lookup

table.NewLookuper(lookuper) -> table.NewLookup().CreateLookuper(lookuper)

Rust FFI consolidation

@fresh-borzoni
Copy link
Contributor Author

@luoyuxia @leekeiabstraction PTAL 🙏

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the C++ bindings’ Table/Connection APIs with the Java/Rust-style builder pattern, while consolidating Rust FFI entrypoints (scanner/upsert) to reduce surface area and duplication.

Changes:

  • Introduce TableAppend / TableUpsert / TableLookup builder-style APIs (NewAppend/NewUpsert/NewLookup) and update examples accordingly.
  • Rename Connection::Connect to Connection::Create to match other languages’ naming.
  • Consolidate Rust FFI scanner creation into create_scanner(...) and upsert writer creation into create_upsert_writer(...).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
bindings/cpp/src/table.cpp Implements new C++ builder objects for append/upsert/lookup and routes scan creation through consolidated FFI.
bindings/cpp/src/lib.rs Consolidates FFI methods (create_scanner, create_upsert_writer) and refactors Table internals to reuse fluss_table().
bindings/cpp/src/connection.cpp Renames connection factory from Connect to Create and small include/format cleanup.
bindings/cpp/include/fluss.hpp Exposes new builder classes and updates the public C++ API accordingly.
bindings/cpp/examples/kv_example.cpp Updates example usage to new builder APIs + Connection::Create.
bindings/cpp/examples/example.cpp Updates example usage to new builder APIs + Connection::Create.
bindings/cpp/examples/admin_example.cpp Updates example usage to Connection::Create.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fresh-borzoni
Copy link
Contributor Author

Addressed comments

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

align CPP Table API with Java/Rust builder pattern

1 participant