Function: buildIdentityAssignments()
buildIdentityAssignments(
sql,info):object
Defined in: Data/Repositories/BaseModuleRepository.ts:94
Build the SET fragment updating the v2 identity block, restricted to the
columns the connected database actually has.
Returns an empty fragment for a v1 database, so a caller can append it unconditionally:
const identity = buildIdentityAssignments(this.sql, info);
this.sql.execute(`UPDATE module_info SET abbreviation = ?${identity.sql} WHERE info_id = 1`,
[info.abbreviation, ...identity.params]);
Column names come from the fixed IDENTITY_COLUMNS list intersected with the live schema — never from caller input — so interpolating them is safe. All values bind as parameters.
Parameters
sql
info
BaseModuleInfo
Returns
object
params
params:
SqlParameter[]
sql
sql:
string