MCPcopy Create free account
hub / github.com/bytebase/dbhub / protocolToConnectorType

Function protocolToConnectorType

src/utils/dsn-obfuscate.ts:187–197  ·  view source on GitHub ↗

* Maps a protocol string to a ConnectorType

(protocol: string)

Source from the content-addressed store, hash-verified

185 * Maps a protocol string to a ConnectorType
186 */
187function protocolToConnectorType(protocol: string): ConnectorType | undefined {
188 const mapping: Record<string, ConnectorType> = {
189 'postgres': 'postgres',
190 'postgresql': 'postgres',
191 'mysql': 'mysql',
192 'mariadb': 'mariadb',
193 'sqlserver': 'sqlserver',
194 'sqlite': 'sqlite'
195 };
196 return mapping[protocol];
197}
198
199/**
200 * Get the default port for a database type

Callers 1

getDatabaseTypeFromDSNFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected