From 4e5f499b488f73ab8fe3df33ba5b435d343f01d3 Mon Sep 17 00:00:00 2001 From: devlikepro Date: Sun, 12 Jan 2025 17:39:31 +0700 Subject: [PATCH] [core] Rename db max name limit --- src/structures/sessions.dto.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/structures/sessions.dto.ts b/src/structures/sessions.dto.ts index 1aeee6c4..a96d89d2 100644 --- a/src/structures/sessions.dto.ts +++ b/src/structures/sessions.dto.ts @@ -166,8 +166,9 @@ export class SessionDetailedInfo extends SessionInfo { engine?: any; } -const MONGO_DB_NAME_LIMIT = 64; -const MONGO_DB_NAME_PREFIX_LEN = 'waha_noweb'.length; +// Affect almost all Databases - Sqlite, MongoDB, Postgres. +const DB_NAME_LIMIT = 64; +const DB_NAME_MAX_PREFIX_LEN = 'waha_noweb'.length; export class SessionCreateRequest { @ApiProperty({ @@ -177,7 +178,7 @@ export class SessionCreateRequest { }) @IsString() @IsOptional() - @MaxLength(MONGO_DB_NAME_LIMIT - MONGO_DB_NAME_PREFIX_LEN) + @MaxLength(DB_NAME_LIMIT - DB_NAME_MAX_PREFIX_LEN) name: string | undefined; @ValidateNested()