Skip to content
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

Enable check constraint reflection #46

Merged
merged 18 commits into from May 23, 2018
Merged

Enable check constraint reflection #46

merged 18 commits into from May 23, 2018

Conversation

SachdevaS
Copy link
Contributor

Check constraint tests work perfectly now, due to changes in SQLAlchemy tests to minimize syntax differences in databases

SachdevaS and others added 15 commits March 20, 2018 09:53
using contextlib because pyhdb does not implement exit and enter method
Also those unique constraints should be returned which do not have a user defined name, but primary keys should not be returned as unique constraints
The test needs to be overwritten, because in case of HANA, if a user tries to reflect the referential action for foreign keys, they are always reflected even if the user does not explicitly change the options to be used, i.e. the default referential action being used by the database is reflected. In no case in SQLAlchemy-hana an empty dictionary is returned for foreign key options.
… differences between different databases, hence check constraints reflection tests work fine
@SachdevaS SachdevaS changed the title Some fixes Enable check constraint reflection May 5, 2018
@@ -56,8 +56,8 @@ def limit_clause(self, select, **kwargs):
text += "\n LIMIT " + self.process(select._limit_clause, **kwargs)
if select._offset_clause is not None:
if select._limit_clause is None:
# Dirty Hack but HANA only support OFFSET with LIMIT <integer>
text += "\n LIMIT 999999"
# 2147384648 is the max. no. of records per (non-partitioned) table
Copy link
Member

Choose a reason for hiding this comment

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

per result set

docs/index.rst Outdated
@@ -109,7 +109,7 @@ SAP HANA also comes with an option to have an IDENTITY column which can also be
LIMIT/OFFSET Support
--------------------

SAP HANA supports both LIMIT and OFFSET, but it only supports OFFSET in conjunction with LIMIT i.e. in the select statement the offset parameter cannot be set without the LIMIT clause, hence in sqlalchemy-hana if the user tries to use offset without limit, a limit of 999999 would be set, this has been done so that the users can smoothly use LIMIT/OFFSET as in other databases that do not have this limitation.
SAP HANA supports both LIMIT and OFFSET, but it only supports OFFSET in conjunction with LIMIT i.e. in the select statement the offset parameter cannot be set without the LIMIT clause, hence in sqlalchemy-hana if the user tries to use offset without limit, a limit of 2147384648 would be set, this has been done so that the users can smoothly use LIMIT/OFFSET as in other databases that do not have this limitation. 2147384648 was chosen, because it is the maximum number of records that a non-partitioned table can have.
Copy link
Member

Choose a reason for hiding this comment

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

As far as I know it is actual the limit of a result set which is more the reason for the choice.

@SachdevaS
Copy link
Contributor Author

Updated

@jarus jarus merged commit 480767c into SAP:master May 23, 2018
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.

None yet

2 participants