Skip to content

Allow users to update schema without restarting the connection #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func Connect(addr string, opts Opts) (conn *Connection, err error) {

// TODO: reload schema after reconnect.
if !conn.opts.SkipSchema {
if err = conn.loadSchema(); err != nil {
if err = conn.LoadSchema(); err != nil {
conn.mutex.Lock()
defer conn.mutex.Unlock()
conn.closeConnection(err, true)
Expand Down
2 changes: 1 addition & 1 deletion schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (indexField *IndexField) DecodeMsgpack(d *decoder) error {
return errors.New("unexpected schema format (index fields)")
}

func (conn *Connection) loadSchema() (err error) {
func (conn *Connection) LoadSchema() (err error) {
schema := new(Schema)
schema.SpacesById = make(map[uint32]*Space)
schema.Spaces = make(map[string]*Space)
Expand Down