Skip to content

Make Client a context manager#23

Merged
merlimat merged 1 commit intooxia-db:mainfrom
merlimat:fix/quality-14-context-manager
Apr 16, 2026
Merged

Make Client a context manager#23
merlimat merged 1 commit intooxia-db:mainfrom
merlimat:fix/quality-14-context-manager

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

Adds __enter__/__exit__ so the client can be used with:

with oxia.Client('localhost:6648') as client:
    client.put('key', 'value')

close() is called automatically when the block exits. Matches the Java SDK's AutoCloseable pattern.

Adds __enter__/__exit__ so the client can be used with:

    with oxia.Client('localhost:6648') as client:
        client.put('key', 'value')

close() is called automatically when the block exits.

Signed-off-by: Matteo Merli <mmerli@apache.org>
@merlimat merlimat merged commit 7ee2f48 into oxia-db:main Apr 16, 2026
6 checks passed
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.

1 participant