Refactor tenant ORM integration (#1650)

* Refactor tenant ORM integration

* fix tests
This commit is contained in:
Weiko
2023-09-19 17:58:28 +02:00
committed by GitHub
parent 07684c4f08
commit ec90c77ec1
38 changed files with 747 additions and 531 deletions

View File

@ -0,0 +1,14 @@
/**
* Converts a UUID to a base 36 string.
* This is used to generate the schema name since hyphens from workspace uuid are not allowed in postgres schema names.
*
* @param uuid
* @returns
*/
export function uuidToBase36(uuid: string): string {
const hexString = uuid.replace(/-/g, '');
const base10Number = BigInt('0x' + hexString);
const base36String = base10Number.toString(36);
return base36String;
}