-
Notifications
You must be signed in to change notification settings - Fork 60
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
base: master
Are you sure you want to change the base?
Conversation
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
5d1b376
to
b869130
Compare
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). |
The dot is missed.
->
|
@@ -1,15 +1,19 @@ | |||
package box_test | |||
package box |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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) |
There was a problem hiding this comment.
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...
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:
But up to you. |
Implemented the
box.Schema()
method that returns aSchema
object for schema-related operationsoriginal-author: maksim.konovalov maksim.konovalov@vk.team
original-date: Tue Dec 24 11:25:05 2024 +0300