Skip to content

OverrideSchema not working as expected #318

Closed
@verybadcoder01

Description

@verybadcoder01

I'm trying to create space with indexes and everything with my go application. At firtst I tried doing this by calling lua functions directly via tarantool.Call(), but that's just painful, so I looked around and found OverrideSchema() function. Unfortunately, I could not find any documentation for it. I wrote some code:

s.conn.OverrideSchema(&tarantool.Schema{
		Version: 1,
		Spaces: map[string]*tarantool.Space{
			"messages": {
				Name: "messages", Id: 1,
				Fields: map[string]*tarantool.Field{
					"time":  {Name: "time", Id: 1, Type: "datetime", IsNullable: false},
					"value": {Name: "value", Id: 2, Type: "string", IsNullable: false},
				},
				Indexes: map[string]*tarantool.Index{
					"primary": {
						Name: "primary", SpaceId: 1, Unique: false,
						Fields: []*tarantool.IndexField{{Id: 1, Type: "datetime"}},
					},
				},
			},
		},
	})

This doesn't seem to do anything. At least, it doesn't create a space in tarantool (and that's what I want). What am I missing? Do I have to stick with direct function calling approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedteamE

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions