-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
[WIP] Add support for SAP HANA #346
Conversation
Great! If you need assistance or have questions feel free to ask. Some notes about this WIP PR, only officially supported drivers are included in the main project, there are some things that need to be done for this:
Thank you for taking time to create a new driver, great to see this! |
Sure! I'd be very excited. Let me test some things first and try to make the most important use cases work first. I will mostly stick to your MySQL implementations as reference. I also work for SAP so I can also give support for this driver. I would also need to check with my legal department (SAP) first before submitting the contribution, but that is usually just formality as my company is very inbound/outbound open-source friendly/driven. I might be also able to provide with a small or shared HANA test instance on SAP HANA Cloud Platform, as HANA is not very cheap to operate for this use case (32GB RAM is the minimum requirement). I can also provide with preparations for Travis CI. |
Added checklist items |
Sounds good, as soon as you have checked back with your legal department just let me know and we will get on the rest of the details. If any questions arise I'm almost always here to help. |
@wzrdtales This does not work:
Returns
|
To have a separation between seeders and migrations there are interfaces: https://github.com/db-migrate/node-db-migrate/blob/master/lib/interface/migratorInterface.js As soon as you add driver specific features, you need to extend the seeder or migration interface. |
Thank you @wzrdtales I'll take a look into it. |
Also one important note: |
Oh, I see. Thanks. Let me fix this. |
By the way, functionality like |
The top level should be for the generic ones, would need to have a look of how common this is over multiple dbmss and then decide, but might be an option to think of. |
Thanks @wzrdtales Works like a charm! I think it would be best to move the driver to the https://github.com/SAP org, because we need to use our CLA in order to allow contributions due to IP topics. We usually do this through https://cla-assistant.io/ I would also not recommend to make the HANA driver a default included package at this point yet. I am required to release it as under Apache 2.0 as far as I know, because I use the Furthermore, the driver might not very stable in the beginning, so I would like to collect feedback from HANA devs first before including it on a broader scope. |
I can license db-migrate different from any driver, they're just drivers which can be plugged in, which itself can use whatever license they want, as long as the licenses allow them to. In this case the drivers are created for db-migrate not the other way around and db-migrate does not depend on them, but can use them. And I'm not sure if you really need to license with the Apache 2.0 license just because of the driver behind it, I would have to take a look at it, but I think they allow the usage from differently licensed products like LGPL does. But I could also be wrong! This is one of the reasons why I mostly always choose licenses that are friendly and less restrictive like MIT or the LGPL. This depends on the project though. Unfortunately, if we can't move the driver into the db-migrate organisation, it wont ever get a officially supported one. But I want to add a community driver listing, to give users a better overview over available drivers. |
In fact to talk a bit more about the licenses: Actually using db-migrate is under the terms of MIT, this one is not very restrictive. It now depends on which driver the end user uses, which license he will deal with. This gets only a problem as soon as someone wants to use db-migrate as a programable module in his project. In this case this project will need to fit with the drivers licenses that are used. But that shouldn't be a problem, as they probably already use the drivers that also the db-migrate drivers use, to make their application work. About Apache 2.0: https://tldrlegal.com/license/apache-license-2.0-%28apache-2.0%29 Apache 2.0 is thus a bit longer than MIT, but still compatible. Thus you must not license your driver under Apache 2.0 if you don't want to. But I'm currently not sure if you need to redistribute the NOTICE file in your project. Thats a bit tricky, it is theoretically always delivered via the npm package management. I would also need to consult lawyer to answer this question. |
As a quick side info, that are all the licenses that db-migrate used modules itself, without drivers, builds on: |
Closing :) If any questions hmu. Drivers are not part of the core. |
NOT READY FOR MERGE
I'm currently developing a HANA driver, as I have found no schema migration tools for HANA so far where migrations can be written in version-able code.
Based on this documentation: https://help.sap.com/saphelp_hanaplatform/helpdata/en/20/9ce8cd75191014bcd59c2b379a17c9/content.htm?frameset=/en/20/a6791f751910148d2bfe3814192a01/frameset.htm¤t_toc=/en/2e/1ef8b4f4554739959886e55d4c127b/plain.htm&node_id=199&show_children=true#jump200
Ground work
hdb
driver for Node.js works already.Map data types
Tables
ALTER TABLE
CREATE TABLE
RENAME TABLE
DROP TABLE
OTHER
Indices
CREATE INDEX
DROP INDEX
ALTER INDEX
RENAME INDEX
Schemas
CREATE SCHEMA
DROP SCHEMA
Columns
RENAME COLUMN
Sequences
CREATE SEQUENCE
DROP SEQUENCE
ALTER SEQUENCE
Views
Statistics
Synonyms
Triggers