Skip to content
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

Schema lookups for spaces and indexes #15

Closed
wants to merge 1 commit into from

Conversation

tehmaze
Copy link

@tehmaze tehmaze commented Apr 22, 2016

This allows one to query available space and index names from the schema, given that the user has read access to the _space and _index spaces.

@mialinx
Copy link

mialinx commented Apr 25, 2016

Excellent!

But we have expected a bit different approach.
Please look at:
#7
#8

It would be greate if you could add just additional field (or method) called Schema to connection structure. Something like that:

type Field struct {
    Name string
    Type string
  }

  type Space struct {
    Id        uint
    Name      string
    Type      string
    Temporary bool
    Fields    []*Field
    Indexes   []*Index
  }

  type Index struct {
    Name   string
    Type   string
    Unique bool
    Fields []*Field
  }

  type Schema struct {
    Spaces  []*Space
    Version uint
  }

  // conn.Schema.Spaces // []*Space
  // conn.Schema.Spaces[1].Indexes  // []*Index
  // conn.Schema.Spaces[1].Fields // []*Field
  // conn.Schema.Space('spacename') // *Space
  // conn.Schema.Space('spacename').Index('indexname') // *Index


conn.Schema field should be populated during connection and atomically updated when schema version number changes (see #7)

@mialinx
Copy link

mialinx commented May 23, 2016

Implemented in b516184

@mialinx mialinx closed this May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants