Skip to content

Use uint64 in C-API instead of string workaround#409

Merged
CGodiksen merged 4 commits into
mainfrom
dev/vacuum-optimize-uint64
Jul 6, 2026
Merged

Use uint64 in C-API instead of string workaround#409
CGodiksen merged 4 commits into
mainfrom
dev/vacuum-optimize-uint64

Conversation

@CGodiksen

Copy link
Copy Markdown
Collaborator

This PR changes the C-API and C header to use unsigned 64-bit integers for the vacuum() and optimize() arguments instead of the previous workaround that used a string and converted the string to u64 in the C-API.

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the modelardb_embedded C-API (and its bindings) to accept optional uint64_t values for vacuum() retention period and optimize() target size, removing the prior string-based workaround.

Changes:

  • Change the C-API functions modelardb_embedded_vacuum() and modelardb_embedded_optimize() to take const uint64_t* (nullable) instead of const char*.
  • Update the Rust C-API implementation to read optional u64 values directly from pointers.
  • Update the Python binding to pass uint64_t* values via cffi for these parameters.

Reviewed changes

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

File Description
crates/modelardb_embedded/src/capi.rs Switch FFI parameter types from C strings to *const u64 and remove string parsing.
crates/modelardb_embedded/bindings/python/modelardb/operations.py Update Python cffi calls to pass uint64_t* instead of char[] strings.
crates/modelardb_embedded/bindings/c/modelardb_embedded.h Update C header signatures to use const uint64_t* for the optional arguments.

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

Comment thread crates/modelardb_embedded/src/capi.rs
Comment thread crates/modelardb_embedded/src/capi.rs
@CGodiksen CGodiksen requested a review from skejserjensen July 6, 2026 08:27
@skejserjensen skejserjensen requested a review from chrthomsen July 6, 2026 09:10
@CGodiksen CGodiksen merged commit 9289e08 into main Jul 6, 2026
5 checks passed
@CGodiksen CGodiksen deleted the dev/vacuum-optimize-uint64 branch July 6, 2026 19:36
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.

4 participants