Skip to content

Commit

Permalink
Tests and documentation updated for schema names made optional for ta…
Browse files Browse the repository at this point in the history
…ble valued functions (#7630)

Co-authored-by: imodeljs-admin <[email protected]>
(cherry picked from commit 74e2f11)

# Conflicts:
#	common/config/rush/pnpm-lock.yaml
#	core/backend/package.json
#	test-apps/display-test-app/android/imodeljs-test-app/app/build.gradle
#	test-apps/display-test-app/ios/imodeljs-test-app/imodeljs-test-app.xcodeproj/project.pbxproj
#	tools/internal/ios/core-test-runner/core-test-runner.xcodeproj/project.pbxproj
  • Loading branch information
soham-bentley authored and mergify[bot] committed Feb 6, 2025
1 parent 98e4e6c commit 29e4d5d
Show file tree
Hide file tree
Showing 12 changed files with 392 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
4 changes: 4 additions & 0 deletions core/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@
"webpack": "^5.76.0"
},
"dependencies": {
<<<<<<< HEAD
"@bentley/imodeljs-native": "4.11.16",
=======
"@bentley/imodeljs-native": "5.0.47",
>>>>>>> 74e2f11e2f (Tests and documentation updated for schema names made optional for table valued functions (#7630))
"@itwin/cloud-agnostic-core": "^2.2.4",
"@itwin/core-telemetry": "workspace:*",
"@itwin/object-storage-azure": "^2.2.5",
Expand Down
8 changes: 4 additions & 4 deletions core/backend/src/test/ecdb/ECSqlQuery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ describe("ECSql Query", () => {
for await (const row of imodel1.createQueryReader("SELECT ECInstanceId FROM BisCore.Element LIMIT 23")) {
ids.push(row[0]);
}
const reader = imodel1.createQueryReader("SELECT * FROM BisCore.element, ECVLib.IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
const reader = imodel1.createQueryReader("SELECT * FROM BisCore.element, IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
let props = await reader.getMetaData();
assert.equal(props.length, 12); // 11 for BisCore.element and 1 for IdSet
let rows = 0;
Expand All @@ -576,7 +576,7 @@ describe("ECSql Query", () => {
ids = row[0]; // getting only the first id
break;
}
const reader = imodel1.createQueryReader("SELECT * FROM BisCore.element, ECVLib.IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
const reader = imodel1.createQueryReader("SELECT * FROM BisCore.element, IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
let props = await reader.getMetaData();
assert.equal(props.length, 12); // 11 for BisCore.element and 1 for IdSet
let rows = 0; // backend will fail to bind so no rows will be returned
Expand All @@ -592,7 +592,7 @@ describe("ECSql Query", () => {
it("concurrent query bind idset with invalid values in IdSet virtual table", async () => {
const ids: string[] = ["0x1","ABC","YZ"];

const reader = imodel1.createQueryReader("SELECT * FROM BisCore.element, ECVLib.IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
const reader = imodel1.createQueryReader("SELECT * FROM BisCore.element, IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
let props = await reader.getMetaData();
assert.equal(props.length, 12); // 11 for BisCore.element and 1 for IdSet
let rows = 0; // backend will bind successfully but some of the values are not valid for IdSet VT so those values will be ignored
Expand All @@ -609,7 +609,7 @@ describe("ECSql Query", () => {
const ids: string[] = ["ABC", "0x1","YZ"]; // as first value is not an Id so QueryBinder.from will throw error of "unsupported type"

try{
imodel1.createQueryReader("SELECT * FROM BisCore.element, ECVLib.IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
imodel1.createQueryReader("SELECT * FROM BisCore.element, IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", QueryBinder.from([ids]));
}catch(err: any){
assert.equal(err.message, "unsupported type");
}
Expand Down
2 changes: 1 addition & 1 deletion core/backend/src/test/ecdb/ECSqlReader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe("ECSqlReader", (() => {
params.bindIdSet(1, ["0x32"]);
const optionBuilder = new QueryOptionsBuilder();
optionBuilder.setRowFormat(QueryRowFormat.UseJsPropertyNames);
reader = ecdb.createQueryReader("SELECT ECInstanceId, Name FROM meta.ECClassDef, ECVLib.IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", params, optionBuilder.getOptions());
reader = ecdb.createQueryReader("SELECT ECInstanceId, Name FROM meta.ECClassDef, IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", params, optionBuilder.getOptions());
const rows = await reader.toArray();
assert.equal(rows[0].id, "0x32");
assert.equal(rows.length, 1);
Expand Down
4 changes: 2 additions & 2 deletions core/backend/src/test/ecdb/ECSqlStatement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,7 @@ describe("ECSqlStatement", () => {
});
});

ecdb.withPreparedStatement("SELECT ECInstanceId, ECClassId, Name from ecdbf.ExternalFileInfo, ECVLib.IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", (stmt: ECSqlStatement) => {
ecdb.withPreparedStatement("SELECT ECInstanceId, ECClassId, Name from ecdbf.ExternalFileInfo, IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", (stmt: ECSqlStatement) => {
let idSet: Id64String[] = [];
stmt.bindIdSet(1, idSet);
let result = stmt.step();
Expand Down Expand Up @@ -1926,7 +1926,7 @@ describe("ECSqlStatement", () => {
});
});

ecdb.withPreparedStatement("SELECT ECInstanceId, ECClassId, Name from ecdbf.ExternalFileInfo, ECVLib.IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", (stmt: ECSqlStatement) => {
ecdb.withPreparedStatement("SELECT ECInstanceId, ECClassId, Name from ecdbf.ExternalFileInfo, IdSet(?) WHERE id = ECInstanceId ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES", (stmt: ECSqlStatement) => {
let idSet: Id64String[] = [];
stmt.bindIdSet(1, idSet);
let result = stmt.step();
Expand Down
Loading

0 comments on commit 29e4d5d

Please sign in to comment.