Skip to content

Captured and virtual sources.

An exact source excerpt. Inspect the complete file to see its imports, surrounding types, and error handling.

internal/ontology/virtual_table.goExcerpt begins at line 47File SHA-256f6a30468bdbea5c006c1fff4fdf551a4c4d2f66dcd35ecf5933214628b396bf4
Captured and virtual sources go
// VirtualConnection returns the one external execution context for the entire// relation set. Mixing physical stores is an explicit unsupported plan, never// a reason to scan or materialize another source implicitly.func (r *Registry) VirtualConnection(datasets []string) (*ConnectionSpec, bool, error) {	var selected *ConnectionSpec	var captured bool	for _, name := range datasets {		d, ok := r.Dataset(name)		if !ok {			return nil, false, fmt.Errorf("source dataset %s does not exist", name)		}		if !d.IsVirtual {			captured = true			continue		}		connection, ok := r.Connection(d.Connection)		if !ok {			return nil, true, fmt.Errorf("virtual source connection is unavailable")		}		if selected != nil && selected.Name != connection.Name {			return nil, true, BadRequest("cross-source virtual queries are unsupported")		}		selected = connection	}	if selected != nil && captured {		return nil, true, BadRequest("joining captured and virtual sources is unsupported")	}	return selected, selected != nil, nil} 
Run it in its product environment.

This source depends on its surrounding product, generated libraries, and platform runtime. The website demonstrations run locally in your browser and do not execute this source against a workspace.