-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(oracle): add support for Oracle DB 18c CI (#15016)
* feat(oracle): add oracle dialect support (#1) * feat(oracle): add oracle dialect support * fix: addressing review comments (#7) * fix: addressing review comments * fix: minor fixes done (#9) * fix: minor fixes to the review comments * fix: merge from sequelize-v6 * fix: enable newly added unit tests for Oracle dialect * fix: remove dangling comma (#13) * fix: doc gen is fixed * fix: autogenerate the primary constraint name (#14) * fix: autogenerate the primary constraint name * fix: remove trailing comma * fix: make changes to ORADERBY as per v6 sync * fix: move test-unit-oracle above test-unit-all * fix: rename getInsertQueryReturnIntoBinds to populateInsertQueryReturnIntoBinds * fix: reorder parameters for function populateInsertQueryReturnIntoBinds * fix: incorporated review comments (#16) * fix: incorporated review comments * fix: modify string empty check with ! * feat: support for Oracle DB 18c * Oracle DB version change * added stop-oracle for 18 * fix: changes to DB version query * fix: cleanup * fix: describetable query fix * fix: dbVersion to remove round trip and 18.4 json test fix * fix: removed dbversion * fix: removed comment * fix: testing a feature * fix: testing a feature * fix: testing a feature * fix: testing a feature * fix: testing a feature * fix: testing a feature * fix: test * fix: test * fix: test * fix: test * fix: using semver to coerce version sring * fix: update to instant client latest version for oracle db 21c * fix: update to oracledb version in package.json * fix: update lockfile * fix: remove duplicate privileges.sql and wait-until-healthy.sh * fix: changes to start-oracle alias * fix: changes to start-oracle alias * fix: changes to start-oracle alias Co-authored-by: Sudarshan Soma <48428602+sudarshan12s@users.noreply.github.com>
- Loading branch information
1 parent
3468378
commit 5f621d7
Showing
14 changed files
with
127 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved | ||
|
||
services: | ||
oraclexedb: | ||
container_name: oraclexedb | ||
image: gvenzl/oracle-xe:18-slim | ||
environment: | ||
ORACLE_PASSWORD: password | ||
ports: | ||
- 1521:1521 | ||
healthcheck: | ||
test: ["CMD-SHELL", "sqlplus", "system/password@XEPDB1"] | ||
retries: 10 | ||
|
||
networks: | ||
default: | ||
name: sequelize-oraclexedb-network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved | ||
|
||
#!/usr/bin/env bash | ||
set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 | ||
|
||
# Remove an existing Oracle DB docker image | ||
docker-compose -p oraclexedb down --remove-orphans | ||
|
||
# Bring up new Oracle DB docker image | ||
docker-compose -p oraclexedb up -d | ||
|
||
# Wait until Oracle DB is set up and docker state is healthy | ||
./../wait-until-healthy.sh oraclexedb | ||
|
||
# Moving privileges.sql to docker container | ||
docker cp ../privileges.sql oraclexedb:/opt/oracle/. | ||
|
||
# Granting all the needed privileges to sequelizetest user | ||
docker exec -t oraclexedb sqlplus system/password@XEPDB1 @privileges.sql | ||
|
||
SEQ_WORKSPACE="$PWD"/../../../ | ||
|
||
if [[ ! -d "$SEQ_WORKSPACE"/.oracle/ ]] | ||
then | ||
mkdir "$SEQ_WORKSPACE"/.oracle/ | ||
if [[ $(uname) == 'Linux' ]] | ||
then | ||
wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-basic-linux.x64-21.7.0.0.0dbru.zip --no-check-certificate && | ||
unzip instantclient-basic-linux.x64-21.7.0.0.0dbru.zip -d "$SEQ_WORKSPACE"/.oracle/ && | ||
rm instantclient-basic-linux.x64-21.7.0.0.0dbru.zip && | ||
mv "$SEQ_WORKSPACE"/.oracle/instantclient_21_7 "$SEQ_WORKSPACE"/.oracle/instantclient | ||
|
||
echo "Local Oracle instant client on Linux has been setup!" | ||
elif [[ $(uname) == 'Darwin' ]] | ||
then | ||
if [[ ! -d ~/Downloads/instantclient_19_8 ]] | ||
then | ||
curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg && | ||
hdiutil mount instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg && | ||
/Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh && | ||
hdiutil unmount /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru && | ||
rm instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg && | ||
mv ~/Downloads/instantclient_19_8/ "$SEQ_WORKSPACE"/.oracle/instantclient | ||
else | ||
cp -rf ~/Downloads/instantclient_19_8/ "$SEQ_WORKSPACE"/.oracle/instantclient | ||
fi | ||
ln -s "$SEQ_WORKSPACE"/.oracle/instantclient/libclntsh.dylib "$SEQ_WORKSPACE"/node_modules/oracledb/build/Release/ | ||
|
||
echo "Local Oracle instant client on macOS has been setup!" | ||
else | ||
# Windows | ||
curl -O https://download.oracle.com/otn_software/nt/instantclient/216000/instantclient-basic-windows.x64-21.6.0.0.0dbru.zip && | ||
unzip instantclient-basic-windows.x64-21.6.0.0.0dbru.zip -d "$SEQ_WORKSPACE"/.oracle/ && | ||
rm instantclient-basic-windows.x64-21.6.0.0.0dbru.zip && | ||
mv "$SEQ_WORKSPACE"/.oracle/instantclient_21_6/* "$SEQ_WORKSPACE"/node_modules/oracledb/build/Release | ||
|
||
echo "Local Oracle instant client on $(uname) has been setup!" | ||
fi | ||
fi | ||
echo "Local Oracle DB is ready for use!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved | ||
|
||
#!/usr/bin/env bash | ||
set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 | ||
|
||
|
||
docker-compose -p oraclexedb down --remove-orphans | ||
|
||
echo "Local Oracle DB instance stopped (if it was running)." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters