MCPcopy Index your code
hub / github.com/Dokploy/dokploy / validUniqueServerAppName

Function validUniqueServerAppName

packages/server/src/services/project.ts:108–148  ·  view source on GitHub ↗
(appName: string)

Source from the content-addressed store, hash-verified

106};
107
108export const validUniqueServerAppName = async (appName: string) => {
109 const query = await db.query.environments.findMany({
110 with: {
111 applications: {
112 where: eq(applications.appName, appName),
113 },
114 libsql: {
115 where: eq(libsql.appName, appName),
116 },
117 mariadb: {
118 where: eq(mariadb.appName, appName),
119 },
120 mongo: {
121 where: eq(mongo.appName, appName),
122 },
123 mysql: {
124 where: eq(mysql.appName, appName),
125 },
126 postgres: {
127 where: eq(postgres.appName, appName),
128 },
129 redis: {
130 where: eq(redis.appName, appName),
131 },
132 },
133 });
134
135 // Filter out items with non-empty fields
136 const nonEmptyProjects = query.filter(
137 (project) =>
138 project.applications.length > 0 ||
139 project.libsql.length > 0 ||
140 project.mariadb.length > 0 ||
141 project.mongo.length > 0 ||
142 project.mysql.length > 0 ||
143 project.postgres.length > 0 ||
144 project.redis.length > 0,
145 );
146
147 return nonEmptyProjects.length === 0;
148};

Callers 9

createMysqlFunction · 0.90
createMongoFunction · 0.90
createComposeFunction · 0.90
createComposeByTemplateFunction · 0.90
createRedisFunction · 0.90
createLibsqlFunction · 0.90
createApplicationFunction · 0.90
createPostgresFunction · 0.90
createMariadbFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected