MCPcopy Index your code
hub / github.com/parse-community/parse-server / getDatabaseAdapter

Function getDatabaseAdapter

src/Controllers/index.js:215–238  ·  view source on GitHub ↗
(databaseURI, collectionPrefix, databaseOptions)

Source from the content-addressed store, hash-verified

213}
214
215export function getDatabaseAdapter(databaseURI, collectionPrefix, databaseOptions) {
216 let protocol;
217 try {
218 const parsedURI = new URL(databaseURI);
219 protocol = parsedURI.protocol ? parsedURI.protocol.toLowerCase() : null;
220 } catch {
221 /* */
222 }
223 switch (protocol) {
224 case 'postgres:':
225 case 'postgresql:':
226 return new PostgresStorageAdapter({
227 uri: databaseURI,
228 collectionPrefix,
229 databaseOptions,
230 });
231 default:
232 return new MongoStorageAdapter({
233 uri: databaseURI,
234 collectionPrefix,
235 mongoOptions: databaseOptions,
236 });
237 }
238}

Callers 1

getDatabaseControllerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected