-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
feat(oracle): adds initial support to the oracle database (WIP) #825
base: master
Are you sure you want to change the base?
Conversation
…ding to the platform getOnUpdateReferentialActions(): string[] getOnDeleteReferentialActions(): string[]
What's the status? I still don't see any test cases in the PR. |
Hi, Martin! |
Sure, no rush :] |
I'm back! |
I thought it would be easier to bring support to oracle, but oracle driver (and the oracle knex dialect) has several details incompatible with the current implementation, especially when it comes to SchemaGenerator. An example is the execution of raw sql, where the oracle driver does not accept the termination with semicolons, except in statements ending with Another example is that to load a .sql file, I had to change here to run it line by line. I think it's necessary to take a look at all the necessary changes to the existing code for everything to work properly (not just for all tests to pass, but to ensure if there is no loss of performance or unexpected effects). I confess that I am little afraid to change the existing framework code for this. For now, as this is taking much longer than I imagined, I am using other alternatives to meet my initial need (which was relatively small compared to the amount of work to be done here), but it will be a pleasure to continue helping if more people want to help implement this in the future, otherwise it is not extremely priority for me too. |
Do you have some links about that? As from what I searched I cannot find a place that would say so. It sounds very weird, hard to believe it :] |
I explained it very badly, sorry.
I mean Oracle PL/SQL blocks. Semicolons are for separating multiple statements, except when the semicolon is part of the statement as is the case with Oracle PL/SQL blocks. In this case, the semicolon at the end is part of a single statement. Knex internally uses the execute() method from oracle-nodedb, that does not allow the execution of multiple statements, and consequently, I believe, statements ending with semicolons. This also causes Ok, now why are PL/SQL blocks important? Because Knex wrap some instructions with it, to catch exceptions (like in dropTableIfExists). Knex had a similar problem and I solved it here.
If you search, you won't find examples where the knex is using semicolons in simple statements as well. Except when the driver itself supports, like as is the case with mysql, when the parameter multipleStatements is added. But this is not something officially supported by knex, is merely supported by each driver, as stated here. So if knex does not officially support it, is not a guarantee of operation in all cases and it's not so hard to believe that it doesn't work in oracle. I haven't tested if removing multipleStatements, it would work with single statements ending with semicolons for MySQL, but with oracle I haven't found a way to make it work. |
This PR brings some initial work for compatibility with oracle databases. It's still a WIP and it is not yet stable. Still lacks automated testing and review of some features.