enforce uppercase UUIDs for MS SQL (#16691)

* add forced uppercase for UUIDs in MS SQL

* test whether mssql returned uuid is uppercase

* use once just for slight better correctness

* once is actually not enough

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
This commit is contained in:
Brainslug
2022-12-15 06:34:31 +01:00
committed by GitHub
parent 431f95210a
commit bbcf76e030
5 changed files with 44 additions and 4 deletions

View File

@@ -0,0 +1,7 @@
import { SchemaHelper } from '../types';
export class SchemaHelperMSSQL extends SchemaHelper {
formatUUID(uuid: string): string {
return uuid.toUpperCase();
}
}

View File

@@ -4,4 +4,4 @@ export { SchemaHelperDefault as redshift } from './dialects/default';
export { SchemaHelperOracle as oracle } from './dialects/oracle';
export { SchemaHelperSQLite as sqlite } from './dialects/sqlite';
export { SchemaHelperDefault as mysql } from './dialects/default';
export { SchemaHelperDefault as mssql } from './dialects/default';
export { SchemaHelperMSSQL as mssql } from './dialects/mssql';

View File

@@ -96,4 +96,8 @@ export abstract class SchemaHelper extends DatabaseHelper {
// reference issue #14873
return existingName;
}
formatUUID(uuid: string): string {
return uuid; // no-op by defaut
}
}