Skip to content

Commit f79f7ba

Browse files
committed
Documentation, test and example updates
1 parent e6d2c59 commit f79f7ba

File tree

9 files changed

+73
-68
lines changed

9 files changed

+73
-68
lines changed

doc/src/api_manual/oracledb.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,11 +684,13 @@ Constants for :ref:`AqEnqOptions Class <aqenqoptionsclass>` and
684684
Continuous Query Notification (CQN) Constants
685685
---------------------------------------------
686686

687-
Constants for the Continuous Query Notification (CQN)
688-
``connection.subscribe()`` option
689-
:ref:`operations <consubscribeoptoperations>`, and for the
690-
notification message :ref:`operation <consubscribeoptcallback>`
691-
properties.
687+
Constants for the Continuous Query Notification (CQN) comprises all the
688+
possible integer mask values for the following properties of the ``options``
689+
parameter in the :meth:`connection.subscribe()` method:
690+
691+
- :ref:`operations <consubscribeoptoperations>` property
692+
- :ref:`operation <consubscribeoptcallback>` property in the
693+
:ref:`message <messageparam>` parameter
692694

693695
.. list-table-with-summary:: Constants for the connection.subscribe() option
694696
``operations`` and notification message ``operation`` Properties.

examples/sampleazuretokenauth.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@ async function run() {
167167
// Configuration for accessTokenConfig:
168168
// clientId: Must be set to app id of Azure's application
169169
// authority: Must be set to a string, in URI format with tenant
170-
// https://{uri}/{tenantId}
170+
// https://{identity provider instance}/{tenantId}
171+
// Common authority URLs:
172+
// https://login.microsoftonline.com/<tenant>/
173+
// https://login.microsoftonline.com/common/
174+
// https://login.microsoftonline.com/organizations/
175+
// https://login.microsoftonline.com/consumers/
171176
// scopes: Must be set https://{uri}/clientID/.default for client
172177
// credential flows
173178
// clientSecret: Can be set only when authType property is set to

test/dataTypeXML.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ describe('181. dataTypeXML.js', function() {
5656
before('create table and insert a row', async function() {
5757
if (oracledb.thin) {
5858
this.skip();
59-
return;
6059
}
6160

6261
const connection = await oracledb.getConnection(dbConfig);
@@ -175,7 +174,7 @@ describe('181. dataTypeXML.js', function() {
175174
}); // 181.4
176175

177176
// ORA-19011: Character string buffer too small
178-
it.skip('181.5 inserts data that larger than 4K', async () => {
177+
it.skip('181.5 inserts data that is larger than 4K', async () => {
179178

180179
const ID = 50;
181180
const str = 'a'.repeat(31 * 1024);

test/jsonDualityViews1.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ describe('272. jsonDualityView1.js', function() {
128128
});
129129

130130
after(async function() {
131-
await connection.execute(`drop table employees PURGE`);
132-
await connection.execute(`drop table departments PURGE`);
131+
await connection.execute(testsUtil.sqlDropTable(`employees`));
132+
await connection.execute(testsUtil.sqlDropTable(`departments`));
133133
await connection.execute(`drop view emp_ov`);
134134
await connection.execute(`drop view dept_ov`);
135135
await connection.close();
@@ -291,8 +291,8 @@ describe('272. jsonDualityView1.js', function() {
291291
});
292292

293293
after(async function() {
294-
await connection.execute(`drop table employees PURGE`);
295-
await connection.execute(`drop table departments PURGE`);
294+
await connection.execute(testsUtil.sqlDropTable(`employees`));
295+
await connection.execute(testsUtil.sqlDropTable(`departments`));
296296
await connection.execute(`drop view emp_ov`);
297297
await connection.execute(`drop view dept_ov`);
298298
await connection.close();
@@ -454,9 +454,9 @@ describe('272. jsonDualityView1.js', function() {
454454
});
455455

456456
after(async function() {
457-
await connection.execute(`drop table student_class`);
458-
await connection.execute(`drop table class`);
459-
await connection.execute(`drop table student`);
457+
await connection.execute(testsUtil.sqlDropTable(`student_class`));
458+
await connection.execute(testsUtil.sqlDropTable(`class`));
459+
await connection.execute(testsUtil.sqlDropTable(`student`));
460460
await connection.close();
461461
});
462462

test/jsonDualityViews2.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ describe('273. jsonDualityView2.js', function() {
9696
const result = await connection.execute(`select * from student order by 1`);
9797

9898
assert.strictEqual(result.rows.length, 3);
99-
await connection.execute(`drop table student PURGE`);
99+
await connection.execute(testsUtil.sqlDropTable(`student`));
100100
});
101101

102102
it('273.2 Base table name with various sizes (128)', async function() {
@@ -116,8 +116,8 @@ describe('273. jsonDualityView2.js', function() {
116116
{StudentId: stuid , StudentName: name}`);
117117

118118

119-
await connection.execute(`drop table hTKFRCNOJyYYvuyUvKsEWhfuObJBjBNnzLVuwqR` +
120-
`faqQAdtXBKxOHeheawjKeezZbgmfJJRhovKkhtwTXXnTWYpojdeawBFuAxPNaDAPjxuRzdpzYcHYwYggVCQueeXiv PURGE`);
119+
await connection.execute(testsUtil.sqlDropTable(`hTKFRCNOJyYYvuyUvKsEWhfuObJBjBNnzLVuwqR` +
120+
`faqQAdtXBKxOHeheawjKeezZbgmfJJRhovKkhtwTXXnTWYpojdeawBFuAxPNaDAPjxuRzdpzYcHYwYggVCQueeXiv`));
121121
});
122122

123123
it('273.3 Perform dbms_metadata.get_ddl() and verify tags were properly added to columns and tables', async function() {
@@ -168,7 +168,7 @@ describe('273. jsonDualityView2.js', function() {
168168
{stuid, NOINSERT }`);
169169
const result = await connection.execute(`select * from student order by 1`);
170170
assert.strictEqual(result.rows.length, 3);
171-
await connection.execute(`drop table student PURGE`);
171+
await connection.execute(testsUtil.sqlDropTable(`student`));
172172
});
173173

174174
it('273.6 Specify DELETE, NODELETE both, BUG number : 34657745', async function() {
@@ -201,7 +201,7 @@ describe('273. jsonDualityView2.js', function() {
201201
/ORA-40934:/ //ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV':
202202
//Invalid or c onflicting annotations in the WITH clause.
203203
);
204-
await connection.execute(`drop table student PURGE`);
204+
await connection.execute(testsUtil.sqlDropTable(`student`));
205205
});
206206

207207
it('273.7 Repetitive tags', async function() {
@@ -226,7 +226,7 @@ describe('273. jsonDualityView2.js', function() {
226226
/ORA-40947:/ //ORA-40947: A JSON relational duality view is created with duplicate tag 'INSERT'
227227
);
228228

229-
await connection.execute(`drop table student PURGE`);
229+
await connection.execute(testsUtil.sqlDropTable(`student`));
230230
});
231231

232232
describe('273.3 Verify view creation on different types of tables', function() {
@@ -247,20 +247,20 @@ describe('273. jsonDualityView2.js', function() {
247247
});
248248

249249
after(async function() {
250-
await connection.execute('drop table student PURGE');
250+
await connection.execute(testsUtil.sqlDropTable('student'));
251251
});
252252

253253
it('273.3.1 View with Heap', async function() {
254254
await connection.execute(`CREATE TABLE t1 (c1 NUMBER PRIMARY KEY, c2 VARCHAR2(30)) ORGANIZATION HEAP`);
255255
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW heap AS t1{c1,c2}`);
256-
await connection.execute(`drop table t1 PURGE`);
256+
await connection.execute(testsUtil.sqlDropTable(`t1`));
257257
await connection.execute(`drop view heap`);
258258
});
259259

260260
it('273.3.2 View with IOT', async function() {
261261
await connection.execute(`CREATE TABLE my_iot (id INTEGER PRIMARY KEY, value VARCHAR2(50)) ORGANIZATION INDEX`);
262262
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW iot AS my_iot{id,value}`);
263-
await connection.execute(`drop table my_iot PURGE`);
263+
await connection.execute(testsUtil.sqlDropTable(`my_iot`));
264264
await connection.execute(`drop view iot`);
265265
});
266266

@@ -281,7 +281,7 @@ describe('273. jsonDualityView2.js', function() {
281281
` ))\n` +
282282
`)`);
283283
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW partition AS sales{prod_id,cust_id}`);
284-
await connection.execute(`drop table sales PURGE`);
284+
await connection.execute(testsUtil.sqlDropTable(`sales`));
285285
await connection.execute(`drop view partition`);
286286
});
287287

@@ -310,7 +310,7 @@ describe('273. jsonDualityView2.js', function() {
310310

311311
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW GTT\n` +
312312
`AS today_sales{order_id}`);
313-
await connection.execute(`drop table today_sales PURGE`);
313+
await connection.execute(testsUtil.sqlDropTable(`today_sales`));
314314
await connection.execute(`drop view GTT`);
315315
});
316316
});
@@ -406,7 +406,7 @@ describe('273. jsonDualityView2.js', function() {
406406
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov AS unq_idx_demo{a,b}
407407
`);
408408

409-
await connection.execute(`drop table unq_idx_demo PURGE`);
409+
await connection.execute(testsUtil.sqlDropTable(`unq_idx_demo`));
410410
await connection.execute('drop view student_ov');
411411
});
412412

@@ -430,7 +430,7 @@ describe('273. jsonDualityView2.js', function() {
430430
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov AS cmp_idx_demo{a,b}
431431
`);
432432

433-
await connection.execute(`drop table cmp_idx_demo PURGE`);
433+
await connection.execute(testsUtil.sqlDropTable(`cmp_idx_demo`));
434434
await connection.execute('drop view student_ov');
435435
});
436436

@@ -450,7 +450,7 @@ describe('273. jsonDualityView2.js', function() {
450450
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov AS members{id,a__b:first_name}
451451
`);
452452

453-
await connection.execute(`drop table MEMBERS PURGE`);
453+
await connection.execute(testsUtil.sqlDropTable(`MEMBERS`));
454454
await connection.execute('drop view student_ov');
455455
});
456456

@@ -471,7 +471,7 @@ describe('273. jsonDualityView2.js', function() {
471471

472472
await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov AS bitmap_index_demo{id,active}`);
473473

474-
await connection.execute(`drop table bitmap_index_demo PURGE`);
474+
await connection.execute(testsUtil.sqlDropTable(`bitmap_index_demo`));
475475
await connection.execute('drop view student_ov');
476476
});
477477
});
@@ -546,7 +546,7 @@ describe('273. jsonDualityView2.js', function() {
546546
/ORA-63101:/ //ORA-63101: JSON Duality View Entity Tag (ETAG) column cannot be redacted
547547
);
548548

549-
await conn.execute(`drop table redact PURGE`);
549+
await conn.execute(testsUtil.sqlDropTable(`redact`));
550550
await conn.close();
551551
});
552552
});

test/jsonDualityViews3.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe('274 jsonDualityView3.js', function() {
139139
StudentId: stuid, StudentName: name
140140
}
141141
`);
142-
await connection.execute(`drop table student PURGE`);
142+
await connection.execute(testsUtil.sqlDropTable(`student`));
143143
await connection.execute(`drop view student_ov`);
144144
});
145145

@@ -169,7 +169,7 @@ describe('274 jsonDualityView3.js', function() {
169169
//ORA-40945: Column 'GROSS_MARGIN' of table 'PARTS' cannot be selected in JSON
170170
//relational duality view as it is virtual.
171171
);
172-
await connection.execute(`drop table parts PURGE`);
172+
await connection.execute(testsUtil.sqlDropTable(`parts`));
173173
});
174174

175175
it('274.3 Have columns of all scalar types, including FLOAT, TIMESTAMP, TIMESTAMP WITH TIME ZONE', async function() {
@@ -202,7 +202,7 @@ describe('274 jsonDualityView3.js', function() {
202202
}
203203
`);
204204

205-
await connection.execute(`drop table stores PURGE`);
205+
await connection.execute(testsUtil.sqlDropTable(`stores`));
206206
await connection.execute(`drop view student_ov`);
207207
});
208208

@@ -222,7 +222,7 @@ describe('274 jsonDualityView3.js', function() {
222222
/ORA-00904:/ //ORA-00904: "SCOTTY__STUDENT__STUID": invalid identifier
223223
);
224224

225-
await connection.execute(`drop table student PURGE`);
225+
await connection.execute(testsUtil.sqlDropTable(`student`));
226226
});
227227

228228
it('274.5 Select over Invisible columns', async function() {
@@ -259,7 +259,7 @@ describe('274 jsonDualityView3.js', function() {
259259
ORDER BY 1 ASC
260260
`);
261261
assert.deepStrictEqual(result2.rows, [['ABC'], ['LMN'], ['XYZ']]);
262-
await connection.execute(`drop table student1 PURGE`);
262+
await connection.execute(testsUtil.sqlDropTable(`student1`));
263263
});
264264

265265
it('274.6 Add is (Ex: "deptno" IS d.department_id)', async function() {
@@ -285,7 +285,7 @@ describe('274 jsonDualityView3.js', function() {
285285
AS student{stuid: stuid, StudentName: name}
286286
`);
287287

288-
await connection.execute(`drop table student PURGE`);
288+
await connection.execute(testsUtil.sqlDropTable(`student`));
289289
await connection.execute(`drop view student_ov`);
290290
});
291291

@@ -305,7 +305,7 @@ describe('274 jsonDualityView3.js', function() {
305305
/ORA-00904:/ //ORA-00904: "INVISIBLE": invalid identifier
306306
);
307307

308-
await connection.execute(`drop table student PURGE`);
308+
await connection.execute(testsUtil.sqlDropTable(`student`));
309309
});
310310

311311
it('274.8 Create view on NULL columns - empty columns', async function() {
@@ -333,7 +333,7 @@ describe('274 jsonDualityView3.js', function() {
333333
ORDER BY 1 ASC
334334
`);
335335
assert.deepStrictEqual(result.rows, [[1], [2], [3]]);
336-
await connection.execute(`drop table student PURGE`);
336+
await connection.execute(testsUtil.sqlDropTable(`student`));
337337
await connection.execute(`drop view student_ov`);
338338
});
339339
});

test/jsonDualityViews4.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('275. jsonDualityView4.js', function() {
181181
assert.deepStrictEqual(result.rows[0], [13, "ABC", "XYZ"]);
182182

183183
// DROP the tables
184-
await connection.execute(`DROP TABLE Persons`);
184+
await connection.execute(`DROP TABLE IF EXISTS Persons`);
185185
});
186186

187187
it('275.3 Test with Virtual columns', async function() {
@@ -718,10 +718,10 @@ describe('275. jsonDualityView4.js', function() {
718718
);
719719

720720
// drop table student_class
721-
await connection.execute(`DROP TABLE student_class`);
721+
await connection.execute(`DROP TABLE IF EXISTS student_class`);
722722

723723
// drop table student
724-
await connection.execute(`DROP TABLE student`);
724+
await connection.execute(`DROP TABLE IF EXISTS student`);
725725

726726
// create table student
727727
await connection.execute(`
@@ -809,7 +809,7 @@ describe('275. jsonDualityView4.js', function() {
809809
FROM student_ov
810810
ORDER BY data.StudentName DESC, json_value(data, '$.StudentId') ASC
811811
`);
812-
assert.deepStrictEqual(result7.rows, [['H', 19], ['F', 4], ['E', 8], ['D', 12], ['C', 81], ['B', 9], ['A', 1]]);
812+
assert.deepStrictEqual(result7.rows, [['H', '19'], ['F', '4'], ['E', '8'], ['D', '12'], ['C', '81'], ['B', '9'], ['A', '1']]);
813813
});
814814
});
815815
});

test/jsonDualityViews5.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,9 @@ describe('276. jsonDualityView5.js', function() {
100100
after(async function() {
101101
if (!isRunnable || dbConfig.test.isCmanTdm) return;
102102

103-
//await connection.execute(`drop table student_class PURGE`);
104-
await connection.execute(`drop table student_class PURGE`);
105-
await connection.execute(`drop table class PURGE`);
106-
await connection.execute(`drop table student PURGE`);
103+
await connection.execute(testsUtil.sqlDropTable('student_class'));
104+
await connection.execute(testsUtil.sqlDropTable('class'));
105+
await connection.execute(testsUtil.sqlDropTable('student'));
107106
await connection.close();
108107

109108
await dbaConn.execute(`drop user njs_jsonDv5 cascade`);
@@ -532,7 +531,7 @@ describe('276. jsonDualityView5.js', function() {
532531
StudentClass :
533532
student_class @insert@update@delete
534533
{StudentClassId : scid,
535-
Class : class {ClassId: clsid, Name: name}}}
534+
Class : class {ClassId: clsid, Name: name}}}
536535
`),
537536
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
538537
conflicting annotations in the WITH clause */
@@ -561,7 +560,7 @@ describe('276. jsonDualityView5.js', function() {
561560
StudentClass :
562561
student_class @insert@update@delete
563562
{StudentClassId : scid,
564-
Class : class {ClassId: clsid, Name: name}}}
563+
Class : class {ClassId: clsid, Name: name}}}
565564
`);
566565

567566
await assert.rejects(

0 commit comments

Comments
 (0)