-
Notifications
You must be signed in to change notification settings - Fork 8
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
Specific integer types and limit-offset support #27
Specific integer types and limit-offset support #27
Conversation
@@ -87,15 +87,30 @@ def visit_FLOAT(self, type_: sa.FLOAT, **kw): | |||
def visit_BOOLEAN(self, type_: sa.BOOLEAN, **kw): |
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 have a doubt about visit_uuid
and implicit convert uuid to UTF8: YDB has own uuid type. Now it can't stored to a table, but it can be (and will sometime) in future. Then convert from uuid to UTF8 will see strange.
I suggest to not convert uuid to UTF-8 into SDK and suggest users to the conversion in customers code. It is simple as str(var)
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.
Discussed in offline: will solved in a separate PR
select._offset_clause, types.UInt64, skip_types=(types.UInt64, types.UInt32, types.UInt16, types.UInt8) | ||
) | ||
if select._limit_clause is None: | ||
text += "\n LIMIT NULL" |
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.
Why do you need explicit LIMIT NULL?
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.
Discussed in offline: it is needed to use OFFSET without LIMIT
Problem
Dialect don't support native usage of
limit().offset()
methods due to type collision: sqlalchemy by default provide all integer bound variables as Int64, when YQL requires UInt variable to be passed to LIMIT OFFSET.In this PR
In this PR I add the optional type casting to the LIMIT OFFSET clause to allow native usage of SQLalchemy methods related to.
Bonus
Dialect was enriched with all integer YDB types.