MCPcopy
hub / github.com/directus/directus / validateDatabaseExtensions

Function validateDatabaseExtensions

api/src/database/index.ts:323–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321 * These database extensions should be optional, so we don't throw or return any problem states when they don't
322 */
323export async function validateDatabaseExtensions(): Promise<void> {
324 const logger = useLogger();
325 const database = getDatabase();
326 const client = getDatabaseClient(database);
327 const helpers = getHelpers(database);
328 const geometrySupport = await helpers.st.supported();
329
330 if (!geometrySupport) {
331 switch (client) {
332 case 'postgres':
333 logger.warn(`PostGIS isn't installed. Geometry type support will be limited.`);
334 break;
335 case 'sqlite':
336 logger.warn(`Spatialite isn't installed. Geometry type support will be limited.`);
337 break;
338 default:
339 logger.warn(`Geometry type not supported on ${client}`);
340 break;
341 }
342 }
343}
344
345async function validateDatabaseCharset(database?: Knex): Promise<void> {
346 const env = useEnv();

Callers 1

createAppFunction · 0.85

Calls 5

useLoggerFunction · 0.85
getDatabaseFunction · 0.85
getDatabaseClientFunction · 0.70
getHelpersFunction · 0.50
supportedMethod · 0.45

Tested by

no test coverage detected