-
Notifications
You must be signed in to change notification settings - Fork 46
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
Dbapi2 #161
Dbapi2 #161
Conversation
It looks as the interesting feature. Thank you! After the first very brief glance:
|
3a6f812
to
69fffb1
Compare
@Totktonada Many thanks for the review! |
14d3b62
to
ab1314a
Compare
I didn't meant squashing all changes into one commit, but get rid of merge commits. It is better to keep commits atomic.
My bad, I missed the inheritance. |
That's my bad too. I see 'Dbapi2 (#160)' commit and had thought that it is the merge commit. Now I see that it is just usual commit. |
08bfd6d
to
9eb8832
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.
I looked over first two commits and over commit messages. Please, consider comments below. I'll continue with looking into the Database API implementation itself.
Comments re commit messages
General:
Please, keep commit message body within 72 symbols.
Regarding 'Set auth request schema to zero in req header':
There is no description of the problem that is resolved here. Just in case, it is the following. It is possible that a database schema is changed on the server during reconnect (or between a last request and reconnect) and the client tries to connect with an old schema id. It is not (generally) possible to fetch the new schema before authentication, so the only way to reconnect is to send authentication request without schema id. Since we don't use any information of the schema, it is harmless.
However it is already in master, see aa8f115 and #141. let's drop the commit.
Regarding 'Add sql execute to connection':
I would close the relevant issue from the commit message: #159.
Regarding 'Add PEP-249 dbapi module (#160)':
Unit tests were taken from dbapi-compliance [3] package.
https://github.com/baztian/dbapi-compliance/
But it is added in the next commit, not here.
will be added in the connector when the feature is stable it Tarantool itself
is stable -> will be stable?
Regarding 'Add unit tests for dbapi module':
removed EOL python 3.4 from appveyor test
This is not actual anymore.
used installer.sh from tarantool.io to set up Tarantool 2.4 version in test.sh
Is it necessary to change the version? If so, a reason should be explained. However I would rather keep everything as is here and test all versions after #124.
BTW, are those tests skipped when we're run testing against 1.10? It seems no, but should.
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.
Comments regarding changes for the base connector, but not dbapi.py itself (commit 'Add PEP-249 dbapi module (#160)').
BTW, I would remove the link to PR #160 from the commit header, because it refers to a draft implementation. I guess it is not what a reader would expect when (s)he will see this link within master
branch.
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.
Comments re dbapi.py (commit 'Add PEP-249 dbapi module (#160)').
I would not consider it as thorough review. I proposed many changes and it would be better to look again after your modifications. Let's ping me, when the PR will be ready.
While looking into this, I marked a status of the standard support. It is below. Please, note that it is not exhaustive status, just my random notes.
PEP 249 Database API
Support status
Core features
!! <cursor>.description
(result set metadata) is not supported yet.
!! No types are defined.
Cursors are emulated.
Prepared statements are emulated.
Transactions are not supported (not supported in tarantool).
Optional <cursor>.callproc()
and <cursor>.nextset()
are no supported (no SQL/PMS support in tarantool).
Extensions
Supported:
- "DB-API extension connection. used"
- "DB-API extension cursor.lastrowid used"
Unsupported:
TBD
Regarding 'set msgpack max version to 0.5.6 for test environment and deps' commit: I think it is quite simple to finish PR #156, this would be better than the workaround. |
89223e7
to
6f43c09
Compare
908d382
to
92c71b3
Compare
af23872
to
4f51516
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.
Looked over the first three commits after the long delay. No objections in general.
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.
Comments for 'Add pep-249 dbapi module'.
I think it is in the good shape.
b14844e
to
d308fa5
Compare
Closes #159 Co-authored-by: Denis Ignatenko <[email protected]>
It is set up to be converted to lists by default. Django expects row type to be tuple. Also tuples tend to perform better than lists and it is good if it can be configurable. Closes #166
See [1] for details. The main motivation for the module creation was the integration Django with Tarantool database through django-tarantool database backend [2] which requires dbapi connector for the database. The most of the optional extensions and methods were ignored because Django does not require them. Anyway, feel free to suggest its implementation as needed. Interactive transactions are not currently supported by Tarantool and theirs implementation will be added in the connector when the feature is stable in Tarantool itself. [1] https://www.python.org/dev/peps/pep-0249/ [2] https://github.com/artembo/django-tarantool Co-authored-by: Denis Ignatenko <[email protected]>
Used dbapi-compliance [1] package to test module according to pep-249 specification. Not implemented features are skipped in the tests. Added dbapi-compliance package to test.sh requirements and appveyor.yml [1] https://github.com/baztian/dbapi-compliance/
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 didn't look again over the whole patchset (sorry), but since all comments from the previous review was fixed, I think, everything should be okay now.
LGTM.
I'm glad that you found strengths to finish the work on the Database API support. It required significant effort, but you accepted the challenge and wins! |
Added
dbapi
module accomplished according to pep-249 specification