Skip to content

Commit daced94

Browse files
committed
docs(credentials): document the database connection provider id helpers
1 parent 0607474 commit daced94

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎apps/sim/lib/credentials/database-connections/descriptors.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,17 @@ function tlsFieldIds<Fields extends readonly DatabaseTlsField[]>(
153153
return fields.map((field) => field.id)
154154
}
155155

156+
/** Whether a provider id names a saved database connection (`postgresql-service-account`, `mysql-service-account`, or `mssql-service-account`). */
156157
export function isDatabaseConnectionProviderId(
157158
value: string | null | undefined
158159
): value is DatabaseConnectionProviderId {
159160
return typeof value === 'string' && Object.hasOwn(DATABASE_CONNECTION_DESCRIPTORS, value)
160161
}
161162

163+
/**
164+
* The saved-connection descriptor for a database provider id, or `undefined`
165+
* when the id is missing or names a provider that is not a database connection.
166+
*/
162167
export function getDatabaseConnectionDescriptor(
163168
providerId: string | null | undefined
164169
): DatabaseConnectionDescriptor | undefined {

0 commit comments

Comments
 (0)