github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/cat/schema.go (about) 1 // Copyright 2018 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package cat 12 13 import "context" 14 15 // Schema is an interface to a database schema, which is a namespace that 16 // contains other database objects, like tables and views. Examples of schema 17 // are "public" and "crdb_internal". 18 type Schema interface { 19 Object 20 21 // Name returns the fully normalized, fully qualified, and fully resolved 22 // name of the schema (<db-name>.<schema-name>). The ExplicitCatalog 23 // and ExplicitSchema fields will always be true, since all parts of the 24 // name are always specified. 25 Name() *SchemaName 26 27 // GetDataSourceNames returns the list of names for the data sources that the 28 // schema contains. 29 GetDataSourceNames(ctx context.Context) ([]DataSourceName, error) 30 }