-
Notifications
You must be signed in to change notification settings - Fork 60
Add minimal sql support #144
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
Conversation
2b5bde5
to
daf1e59
Compare
I've faced some issue. I realized that I can't write exapmles of using SQL in connector with covering it by tests in |
daf1e59
to
5baa19e
Compare
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.
Thank you for your patch! It would be really nice to support SQL in connector.
It seems that #62 is now a ticket about SQL EXECUTE support and SQL PREPARE is expected to be supported as the solution of #117 . It is not obvious from issue's name, so I leave this info here for future reviewers.
I don't have an experience with supporting SQL in connectors, so some things seems confusing to me right now. I left some comments, but later I'll try to give this PR a more thorough review.
@vr009, see go-tarantool/uuid/uuid_test.go Lines 154 to 165 in bec9f72
|
45271e2
to
f65d459
Compare
f65d459
to
6875af2
Compare
9edb202
to
b5da729
Compare
0b83fb9
to
154800d
Compare
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.
LGTM after minor language fixes.
(To be honest, I'm not confident in my English and it is possible that I added a couple of new mistakes.)
58632f6
to
341b74d
Compare
Sure, that is our goal in scope of #117. |
9e7804f
to
3a39ba0
Compare
3a39ba0
to
caaa9cd
Compare
9a2233c
to
b942c5e
Compare
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.
Почти готово.
Исправь хотя бы FieldByName(key)
на Field(i)
, и будем считать, что ok.
b942c5e
to
803a6ce
Compare
76cd593
to
d3bbbb7
Compare
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.
LGTM, see comment about godoc
d3bbbb7
to
3b99735
Compare
_, err = conn.Replace(spaceNo, []interface{}{uint(1111), "hello", "world"}) | ||
if err != nil { | ||
b.Errorf("No connection available") | ||
} |
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.
Is it not the same space as used in the SELECT
query below (SQL_TEST
)?
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.
Yes, the spaceNo
was from another one, fixed. Thank you.
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.
I glanced over the changes briefly and have no objections. Feel free to proceed.
This patch adds the support of SQL in connector. Added support of positional and named arguments. Added ExecuteTyped() method for use with custom packing/unpacking for a type. Added all required constants to const.go for encoding SQL in msgpack and decoding response. Added SQL tests. Updated config.lua for creation the space for using SQL in tests. Added the check of Tarantool version to skip SQL tests if tarantool version < 2.0.0. Changed id of the test spaces with id=512 and id=514, cause if using SQL in tarantool there is no ability to set space id explicitly, so it gets created with id=512 by default and conflicts with already existing space with the same id. Added new dependency in go.sum, go.mod for using assert package. Added examples of using SQL queries in example_test.go for compiling the future documentation from sources. Added notes about the version since which Execute() is supported. Closes #62
3b99735
to
9d41e1e
Compare
This patch adds the support of SQL in connector.
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if Tarantool version < 2.0.0.
Fixes #62