Skip to content

feat: add v1 of session apis#27

Draft
9401adarsh wants to merge 1 commit intolancedb:mainfrom
9401adarsh:wip-adashoka-session-bindings
Draft

feat: add v1 of session apis#27
9401adarsh wants to merge 1 commit intolancedb:mainfrom
9401adarsh:wip-adashoka-session-bindings

Conversation

@9401adarsh
Copy link

This PR addresses #17.

What's been implemented?

  • Added session FFI types and APIs in Rust under src/connection.rs.
  • Added matching public C API declarations under include/lancedb.h.
  • Added coverage tests for session C API under tests/test_connection.cpp.
  • Added docs under docs/index.rst.

To-Discuss and Pending Items:

  • Object Store Registry - how to go about implementing this interface? Current implementations initiates session with default Object Store Registry, no registry API exposed.
  • Add a simple example on custom session.
  • A full integration test with table search using a connection with a custom session.

Signed-off-by: 9401adarsh <dev.9401adarsh@gmail.com>
@9401adarsh
Copy link
Author

Hi @yuvalif, have started work on the issue. Please have a look and let me know your thoughts.

@yuvalif yuvalif self-requested a review March 9, 2026 15:02
REQUIRE(builder != nullptr);
builder = lancedb_connect_builder_storage_option(builder, "hello", "world");
REQUIRE(builder != nullptr);
builder = lancedb_connect_builder_session(builder, nullptr);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is tested in line 77. why do you need it here?

Copy link
Author

@9401adarsh 9401adarsh Mar 9, 2026

Choose a reason for hiding this comment

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

I wanted to check for operator chaining, i.e if i am able to both storage option and session with the same object - as the original SDK allows for it.

Will drop it if you fell this isn't needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

you are right. keep this test

@yuvalif
Copy link
Collaborator

yuvalif commented Mar 9, 2026

as discussed, please add the following tests:

  • tables: use the same session with multiple tables
  • query: query a table from a db that has a session several times and verify using session stats that there were cache hits

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.

2 participants