Oracle Free
Install
| npm install @testcontainers/oraclefree --save-dev
|
Examples
These examples use the following libraries:
Recommended to use an image from this registry and substitute for IMAGE
Start a database and execute queries
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 | const customDatabase = "TESTDB";
const customUsername = "CUSTOMUSER";
const customPassword = "customPassword";
await using container = await new OracleDbContainer(IMAGE)
.withDatabase(customDatabase)
.withUsername(customUsername)
.withPassword(customPassword)
.start();
const connection = await oracledb.getConnection({
user: container.getUsername(),
password: container.getPassword(),
connectString: container.getUrl(),
});
const result = await connection.execute("SELECT SYS_CONTEXT('USERENV', 'CON_NAME') FROM DUAL");
expect(result.rows![0]).toEqual([customDatabase]);
const resultUser = await connection.execute("SELECT USER FROM DUAL");
expect(resultUser.rows![0]).toEqual([customUsername]);
await connection.close();
|