Skip to content

Commit 471705c

Browse files
committed
docs(credentials): document the database connection descriptor and id types
1 parent 5fe7134 commit 471705c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
POSTGRESQL_SERVICE_ACCOUNT_PROVIDER_ID,
2020
} from '@/lib/oauth/types'
2121

22+
/** The `service_account` provider id of a saved PostgreSQL, MySQL, or SQL Server connection. */
2223
export type DatabaseConnectionProviderId =
2324
| typeof POSTGRESQL_SERVICE_ACCOUNT_PROVIDER_ID
2425
| typeof MYSQL_SERVICE_ACCOUNT_PROVIDER_ID
@@ -34,6 +35,10 @@ interface DatabaseTlsField {
3435
hint: string
3536
}
3637

38+
/**
39+
* Everything the connect modal, the provider catalog, and the blocks need to
40+
* know about one saved database connection type, without server-only code.
41+
*/
3742
export interface DatabaseConnectionDescriptor {
3843
providerId: DatabaseConnectionProviderId
3944
/** The OAuth service id its blocks' picker and tools name. */
@@ -126,6 +131,7 @@ export const DATABASE_CONNECTION_DESCRIPTORS = {
126131

127132
const DATABASE_LOGIN_FIELD_IDS = ['host', 'port', 'database', 'username', 'password'] as const
128133

134+
/** A field a saved connection of provider `P` stores: a login field or one of its TLS settings. */
129135
export type DatabaseConnectionFieldId<P extends DatabaseConnectionProviderId> =
130136
| (typeof DATABASE_LOGIN_FIELD_IDS)[number]
131137
| (typeof DATABASE_CONNECTION_DESCRIPTORS)[P]['tls'][number]['id']

0 commit comments

Comments
 (0)