github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/cat/object.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 // Object is implemented by all objects in the catalog. 14 type Object interface { 15 // ID is the unique, stable identifier for this object. See the comment for 16 // StableID for more detail. 17 ID() StableID 18 19 // DescriptorID is the descriptor ID for this object. This can differ from the 20 // ID of this object in some cases. This is only important for reporting the 21 // Postgres-compatible identifiers for objects in the various object catalogs. 22 // In the vast majority of cases, you should use ID() instead. 23 PostgresDescriptorID() StableID 24 25 // Equals returns true if this object is identical to the given Object. 26 // 27 // Two objects are identical if they have the same identifier and there were 28 // no changes to schema or table statistics between the times the two objects 29 // were resolved. 30 // 31 // Used for invalidating cached plans. 32 Equals(other Object) bool 33 }