MCPcopy Create free account
hub / github.com/dolthub/doltgresql / VitessTypeToObjectID

Function VitessTypeToObjectID

server/connection_data.go:219–225  ·  view source on GitHub ↗

VitessTypeToObjectID returns a type, as defined by Vitess, into a type as defined by Postgres. OIDs can be obtained with the following query: `SELECT oid, typname FROM pg_type ORDER BY 1;`

(typ sql.Type)

Source from the content-addressed store, hash-verified

217// VitessTypeToObjectID returns a type, as defined by Vitess, into a type as defined by Postgres.
218// OIDs can be obtained with the following query: `SELECT oid, typname FROM pg_type ORDER BY 1;`
219func VitessTypeToObjectID(typ sql.Type) (uint32, error) {
220 doltgresType, err := pgtypes.FromGmsTypeToDoltgresType(typ)
221 if err != nil {
222 return 0, err
223 }
224 return id.Cache().ToOID(doltgresType.ID.AsId()), nil
225}
226
227// checkCompatibleTypes checks if multiple types for which a parameter are used are compatible.
228func checkCompatibleTypes(ctx *sql.Context, existingOid, newOid uint32, newName string) error {

Callers 2

extractBindVarTypesFunction · 0.85

Calls 3

CacheFunction · 0.92
ToOIDMethod · 0.80
AsIdMethod · 0.45

Tested by

no test coverage detected