sqlectron / sqlectron-db-core

Home Page:https://sqlectron.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for oracle

darkwisperer opened this issue · comments

First off I plan to submit a PR for this. There were a couplethings I wanted feedback on.

jsdbc is the npm package I am leaning towards using since it does not require the Oracle libs to be downloaded seperatly. The bonus to using jsdbc is that it supports SQLite. Which would allow the addition of two more database clients with little extra work.

The other option is the Oracle supported oracledb which require python 2.7, C Compiler with support for C++ 11, the oracle client libraries (OS specific). I think that these added "requirements" would bloat the core and add unnecessary complexities for the releases per OS.

Now I know I can get manual tests with oracle set up easily. I could not find a single CI that supported Oracle as a DB. I was thinking that Oracle would be a manual only test. Any thoughts or advice on this would be appreciated.

Hi @darkwisperer,

Even with a more difficult configuration I rather use the official package oracledb because seems have a better support. And including the sqlite later with a separated lib should not be so difficult.

I think we can ignore by default the integration tests on oracle. Something like knex does.

Seems is possible to use Oracle with Travis Ci through this script https://github.com/cbandy/travis-oracle.
In case is not really possible use a CI with Oracle I still can run the test over a docker image https://hub.docker.com/_/oraclelinux/. So could run the tests manually at least before every new release.

And thanks for the interest helping this project 😄

Sounds good. Nice find for Travis-CI! I will start working on this and attempt to get CI testing through travis for it.

Since Oracledb package requires certain libs and reqs, how do we want to go about making sure the host meets these requirements?
We might have to add a repo for the libs per OS since the only way to get them from Oracle is manual.

Progress has been slow but its getting there.

Is this problem related to the dev environment or the "production" environment?

For the production environment, I think there is no problem. Since the electron app is released with all dependencies built in. I was thinking in just check if the oracle is available before requiring the oracle module or something like that.

For the dev environment. Does it throw any error on installing the oracle lib without have the oracle already installed?

  • If it does not. We could do the same of production environment.
  • If it does. I think we could let the oracle out of the dev dependencies. And document it must be installed manually for those working with oracle.

Its required for both dev/testing and for release. If the libs or reqs are missing the npm install of oracledb fails and raises an error.

I don't care installing the oracle on my machine to release the app.
And for dev/testing I guess we could try that last approach I mentioned earlier. Is a similar approach Knex does. They have support for oracle as well, but is not included in the dev dependencies. This way anyone that need to test oracle, have to install the oracle by themselves.

Sounds good. I will make sure to keep oracle out of the dev dependencies.

Hey @darkwisperer , how are you standing with this? :)

HI @BornaP,
I ran into issues getting the tests to run on my dev VM (postgres caused issues when trying to singularly test oracle, I probably had config issues), then life got in the way. I don't think I will be able to work on it any time soon. :(
If you are feeling industrious, it is up for grabs. :)

Oh, sorry to hear that :/ Well then, I'll probably take a look next week if this will still be open.

This issue still alive?

I believe nobody is working on this now.

Okok :( , Do you know if someone can take this?

Sorry, I don't use Oracle. So I have no interest investing my time on this. If you are interested in helping. Please send a PR. I could help with any development question you have. Otherwise lets still waiting for somebody else :(

How does one go about working on this one? Our office heavily uses oracle and I have grown tired of using Oracle SQL Developer.

I would like to work on this issue.

Sure, you're more than welcome to contribute. I think nobody is working on this issue right now.

Just a thought, what if the bulky oracledb package could be optionally downloaded by the end user? IntelliJ Ultimate does something similar where you click a button to download the JDBC jars the first time you use a particular database type.

There could be a function downloadOracleLibs() that would download and unpack a specific version in the sqlectron config directory, then an integration built in db/clients that checks for the presence of the libs before exporting anything.

Hi there, is anyone working on this?

I’d planned to but after a few hours struggling to get a dockerized oracledb to work I gave up and did something else. I learned some things that I could post later.

I'd like to try,.. is the dockerized part necessary? I have an Ora Express VM running that I indended to use for this.

The docker setup would help other contributors who don't have Oracle setup locally. Also, it would allow running tests for it on CI to make sure new releases don't include bugs to existing code.

Hey guys, is there a PR or some code to work on for getting this going?

For anyone interested in working on this, Oracle has a repo with some instructions on building images here: https://github.com/oracle/docker-images/tree/master/OracleDatabase/SingleInstance#readme

For example, you can build an Oracle XE (Express Edition) 18 image like this:

git clone https://github.com/oracle/docker-images.git
cd docker-images/OracleDatabase/SingleInstance/dockerfiles
# Workaround for https://github.com/oracle/docker-images/issues/1797
sed -i 's/yum -y install openssl oracle-database-preinstall-18c/yum -y install expect openssl oracle-database-preinstall-18c/' 18.4.0/Dockerfile.xe
sed -i 's/yum -y localinstall $INSTALL_FILE_1/unbuffer yum -y localinstall $INSTALL_FILE_1/' 18.4.0/Dockerfile.xe
./buildDockerImage.sh -v 18.4.0 -x

Then you can run it like this:

docker run --rm -p 1521:1521 oracle/database:18.4.0-xe

It will generate a password for you and output it near the top of the docker run command, or you can define one using ORACLE_PWD, e.g. docker run -e ORACLE_PWD=changeme ...

Connect using user: system and SID: XE