Skip to content

Commit

Permalink
oracle db wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars-Erik Roald committed Jan 1, 2024
1 parent e95e292 commit 015debb
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,12 @@ services:
ports:
- 50000:5000
# restart: always
oracle:
image: gvenzl/oracle-xe
environment:
- ORACLE_PASSWORD=P@assword123
hostname: oracle
ports:
- 1521:1521
volumes:
try-node-node_modules:
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
image: larsroald/ase-server
ports:
- 5000:5000
oracle:
image: gvenzl/oracle-xe
env:
- ORACLE_PASSWORD=P@assword123
ports:
- 1521:1521
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"glob": "^10.3.4",
"module-definition": "^4.0.0",
"node-cls": "^1.0.5",
"oracledb": "^6.3.0",
"promise": "^8.0.3",
"rfdc": "^1.2.0",
"uuid": "^8.3.2"
Expand Down
33 changes: 33 additions & 0 deletions src/oracle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const oracledb = require('oracledb');

async function run() {
let connection;

try {
connection = await oracledb.getConnection({
user: 'sys',
password: 'P@assword123',
connectString: 'oracle/XE',
privilege: oracledb.SYSDBA
});

// Replace with your query
const result = await connection.execute(
'SELECT \'Hello, World!\' FROM DUAL'
);
console.log(result.rows);

} catch (err) {
console.error(err);
} finally {
if (connection) {
try {
await connection.close();
} catch (err) {
console.error(err);
}
}
}
}

run();

0 comments on commit 015debb

Please sign in to comment.