Browse Source

feat(nocodb): add getMaxColumnNameLength

pull/5131/head
Wing-Kam Wong 2 years ago
parent
commit
b67f313446
  1. 13
      packages/nocodb/src/lib/models/Column.ts

13
packages/nocodb/src/lib/models/Column.ts

@ -1151,4 +1151,17 @@ export default class Column<T = any> implements ColumnType {
colId
);
}
static getMaxColumnNameLength(sqlClientType: string) {
// no limit for sqlite but set as 255
let fieldLengthLimit = 255;
if (sqlClientType === 'mysql2' || sqlClientType === 'mysql') {
fieldLengthLimit = 64;
} else if (sqlClientType === 'pg') {
fieldLengthLimit = 59;
} else if (sqlClientType === 'mssql') {
fieldLengthLimit = 128;
}
return fieldLengthLimit;
}
}

Loading…
Cancel
Save