Skip to content

box: added logic for working with Tarantool schema #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bigbes
Copy link

@bigbes bigbes commented Jun 20, 2025

Implemented the box.Schema() method that returns a Schema object for schema-related operations

original-author: maksim.konovalov maksim.konovalov@vk.team
original-date: Tue Dec 24 11:25:05 2024 +0300

Implemented the `box.Schema()` method that returns a `Schema`
object for schema-related operations

original-author: maksim.konovalov <maksim.konovalov@vk.team>
original-date:   Tue Dec 24 11:25:05 2024 +0300
@bigbes bigbes force-pushed the bigbes/TNTP-3331-box-schema-wrappers branch from 5d1b376 to b869130 Compare June 20, 2025 16:46
@oleg-jukovec
Copy link
Collaborator

Is this PR ready for review? If so, please assign two reviewers from the team (usually one of them is the repository maintainer, but it is not necessary).

@oleg-jukovec
Copy link
Collaborator

The dot is missed.

Implemented the `box.Schema()` method that returns a `Schema`
object for schema-related operations

->

Implemented the `box.Schema()` method that returns a `Schema`
object for schema-related operations.

@@ -1,15 +1,19 @@
package box_test
package box
Copy link
Collaborator

@oleg-jukovec oleg-jukovec Jun 20, 2025

Choose a reason for hiding this comment

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

Suggested change
package box
package box_test

Nit: please, test only the public API unless otherwise really necessary.

I know that the connector is currently testing by private API in some cases. It would be nice if we could fix that in the future.

But for now, we could just to avoid the wrong way and test only the public API.

Comment on lines +40 to +48
b := New(&doer)
schemaObject := b.Schema()
assert.Equal(t, &doer, schemaObject.conn)

userSchemaObject := b.Schema().User()
assert.Equal(t, &doer, userSchemaObject.conn)

sessionObject := b.Session()
assert.Equal(t, &doer, sessionObject.conn)
Copy link
Collaborator

@oleg-jukovec oleg-jukovec Jun 20, 2025

Choose a reason for hiding this comment

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

You could create a mock of the Doer interface here and make sure that the methods are called exactly from the mock instead of sharing the internal implementation. Or something like that...

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Jun 20, 2025

original-author: maksim.konovalov <maksim.konovalov@vk.team>
original-date:   Tue Dec 24 11:25:05 2024 +0300

It looks a bit ugly for me. For example, I don’t understand why the timestamp might be useful to us. I like the co-authored-by label in the commit message instead:

Co-authored-by: NAME <NAME@EXAMPLE.COM>

But up to you.

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