Skip to content

initial version to make BusinessBase compatible with multiple adaptes and support for concatenated-columns#176

Open
durlabhjain wants to merge 3 commits into
mainfrom
durlabh/business-base-multiple-adapter
Open

initial version to make BusinessBase compatible with multiple adaptes and support for concatenated-columns#176
durlabhjain wants to merge 3 commits into
mainfrom
durlabh/business-base-multiple-adapter

Conversation

@durlabhjain

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 9, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces early multi-database adapter support in BusinessBase (by routing through a DB adapter instance) and adds initial support for “concatenated columns” in list results and filters.

Changes:

  • Added adapter-level paging helpers (addPaging) for SQL Server and MySQL.
  • Refactored BusinessBase to use an adapter getter and added support for queryFileName-driven list statements.
  • Added a new ConcatenatedColumns helper and integrated it into BusinessBase.list() (for filtering and for populating concatenated fields).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
lib/sql.js Adds Sql.addPaging() helper for MSSQL pagination.
lib/mysql.js Adjusts MySQL runQuery() return shape and adds Mysql.addPaging().
lib/business/concatenated-columns.mjs New helper to populate concatenated columns and generate subquery filters.
lib/business/business-base.mjs Routes through adapter instance, adds queryFileName, concatenated-columns filtering and post-processing, and uses adapter paging.

Comment thread lib/sql.js
Comment thread lib/mysql.js
Comment thread lib/business/business-base.mjs
Comment thread lib/business/business-base.mjs
Comment thread lib/business/business-base.mjs
Comment thread lib/business/concatenated-columns.mjs
Comment thread lib/business/concatenated-columns.mjs Outdated
Comment thread lib/business/concatenated-columns.mjs
Comment thread lib/business/concatenated-columns.mjs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

@@ -819,8 +833,39 @@ class BusinessBase {
}
if (whereArr.length) {
whereArr.forEach((ele) => {
Comment on lines +857 to +865
where[`filter_${index}`] = {
statement: ConcatenatedColumns.applyStringFilter({
value: filterValue.value,
concatenatedColumn,
request,
paramName,
operator: filterValue.operator
})
};
if (listResult.records?.length && concatenatedColumns.length) {
const resultValue = await ConcatenatedColumns.addColumns({ records: listResult.records, sql, columns: concatenatedColumns });
if (resultValue !== null && resultValue !== undefined) {
listResult.records = resultValue.recordset;
Comment on lines 679 to 681
const result = await request.query(lookupListStatement);
return result.recordset;
}
Comment on lines +308 to 311
const sql = this.getDatabaseAdapter();
const request = sql.createRequest();

query = sql.addParameters({ query, request, parameters: where, forWhere: true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants