tarantool / go-tarantool

Tarantool 1.10+ client for Go language
https://pkg.go.dev/github.com/tarantool/go-tarantool/v2
BSD 2-Clause "Simplified" License
180 stars 57 forks source link

api: write a connection schema getter #355

Closed DerekBum closed 9 months ago

DerekBum commented 9 months ago

Write a helper function to load the actual schema for the user.

Previously we stored actual schema in a private schemaResolver field and Schema field was used only to get a current schema. But now because of the new function, we don't need to store the Schema as a different field. So Schema was also removed.

To update the schema, one needs to use GetSchema + SetSchema in pair. SetSchema(Schema) replacing the OverrideSchema(*Schema).

Spaces and SpacesById fields of the Schema struct store spaces by value. Fields and FieldsById fields of the Space struct store fields by value. Index and IndexById fields of the Space struct store indexes by value. Fields field of the Index struct store IndexField by value.

I didn't forget about (remove if it is not applicable):

Closes #7