pub(crate) fn resolve_connection_ref_and_secret_ref(
with_options: WithOptions,
session: &SessionImpl,
object: Option<TelemetryDatabaseObject>,
) -> Result<(WithOptionsSecResolved, PbConnectionType, Option<u32>), RwError>
Expand description
Resolves connection references and secret references in WithOptions
.
This function takes WithOptions
(typically from a CREATE/ALTER statement),
resolves any CONNECTION and SECRET references, and merges their properties
with the directly specified options.
§Arguments
with_options
- The originalWithOptions
containing user-specified options and referencessession
- The current user session, used to access catalogs and verify permissionsobject
- Optional telemetry information about the database object being created/altered
§Returns
A tuple containing:
WithOptionsSecResolved
-WithOptions
with all references resolved and mergedPbConnectionType
- The type of the referenced connection (if any)Option<u32>
- The ID of the referenced connection (if any)
§Workflow
- Extract connector name, options, secret refs, and connection refs from
with_options
- Resolve any CONNECTION references by looking them up in the catalog
- Resolve any SECRET references by looking them up in the catalog
- Merge properties from CONNECTION with directly specified options
- Perform validation to ensure no conflicts between options
- Return the merged options, connection type, and connection ID