package
0.4.8
Repository: https://github.com/coralproject/shelf.git
Documentation: pkg.go.dev

# README

cmddb

import "github.com/coralproject/shelf/cmd/xenia/cmddb"

Overview

Index

Package files

commands.go create.go

Variables

var (
    // ErrCollectionExists is return when a collection to be
    // created already exists.
    ErrCollectionExists = errors.New("Collection already exists.")
)

func GetCommands

func GetCommands(db *db.DB) *cobra.Command

GetCommands returns the db commands.

type Collection

type Collection struct {
    Name    string  `json:"name"`
    Indexes []Index `json:"indexes"`
}

Collection is the container for a db collection definition.

type DBMeta

type DBMeta struct {
    Cols []Collection `json:"collections"`
}

DBMeta is the container for all db objects.

type Field

type Field struct {
    Name      string `json:"name"`
    Type      int    `json:"type"`
    OtherType string `json:"other"`
}

Field is the container for a field definition.

type Index

type Index struct {
    Name     string  `json:"name"`
    IsUnique bool    `json:"unique"`
    Fields   []Field `json:"fields"`
}

Index is the container for an index definition.


Generated by godoc2md

# Functions

GetCommands returns the db commands.

# Variables

ErrCollectionExists is return when a collection to be created already exists.

# Structs

Collection is the container for a db collection definition.
DBMeta is the container for all db objects.
Field is the container for a field definition.
Index is the container for an index definition.