dsql-admin/dsql-app/package-shared/utils/check-if-is-master.ts

15 lines
358 B
TypeScript
Raw Normal View History

2025-01-28 18:43:16 +00:00
type Param = {
dbContext?: "Master" | "Dsql User";
dbFullName?: string;
};
export default function checkIfIsMaster({ dbContext, dbFullName }: Param) {
return dbContext?.match(/dsql.user/i)
? false
: global.DSQL_USE_LOCAL
? true
: dbFullName && !dbFullName.match(/^datasquirel$/)
? false
: true;
}