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
Implement deferrable foreign keys for SAP HANA #6104
Implement deferrable foreign keys for SAP HANA #6104
Conversation
You need to add tests for this feature. |
Looks like no response from author, closing it. |
There was nothing to respond, tests for HANA are non-existent and the local test setup is not described anywhere as far as I remember.
|
BTW, we maintain a lot of patches for the HANA driver locally, we just avoid creating PRs for this reason. We test them as part of our E2E, but since we have no idea how to run the TypeORM tests with HANA locally + the slow PR review process makes us avoid submitting PRs. |
It can be a good contribution if you find the way to setup SAP Hana on CI. Then it will simplify process of merging (at least we can be sure nothing was broke). |
@pleerock The easiest way would be with a HANA Cloud instance. The only required setup in that case would be the hostname and the credentials. Then every time the tests are run a DB schema could be created for that run and dropped when it's over. The main question would be how to get access to a HANA Cloud instance (it could get quite pricey) - maybe SAP could donate it? |
We need something free. Can't we simply setup something in a docker container for our CI? |
@pleerock HANA Cloud (v4.0) has a free trial (I think it's limited to 30 days but can be extended to 90 days). Not sure how to get the free 1 year advertised on their website. There's also the possibility to run HANA express (v2.0) inside a container, it seems it's free up to 32gb memory: |
if it has a time period limit its not an option for us.
would be great if someone can contribute and setup sap-hana-express-edition container in our CI, so we can run tests inside it. |
thank you for contribution! |
Related feature request: #6098, #2191.
I've added deferrable (check time) options for foreign keys on SAP HANA. See
<references_specification>
in the CREATE TABLE and ALTER TABLE specification:as well as the REFERENTIAL_CONSTRAINTS system table in their official documentation:
CHECK_TIME
STRING
INITIALLY_IMMEDIATE
orINITIALLY DEFERRED
.Notes:
deferrable
attribute inRelationOptions
, that has the possible valuesINITIALLY IMMEDIATE
andINITIALLY DEFERRED
, same as the specification for theREFERENCES
SQL expression.REFERENTIAL_CONSTRAINTS
table, the possible values areINITIALLY_IMMEDIATE
(with underscore) andINITIALLY DEFERRED
(with space).