mindsdb

package
v0.0.0-...-c0c544a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(apiUrl, email, password string) (*connectors.RestAPI, error)

func Error

func Error(message string) error

func HandleError

func HandleError(err error)

func LoadEnvFromFile

func LoadEnvFromFile(filepath string) error

func MindsDBClient

func MindsDBClient(baseURL string) *connectors.RestAPI

Types

type Database

type Database struct {
	Name   string
	Tables []connectors.Record
	Server *Server
	Api    *connectors.RestAPI
}

func NewDatabase

func NewDatabase(server *Server, name string) *Database

func (*Database) CreateTable

func (d *Database) CreateTable(name string, query *Query, replace bool) (*Table, error)

func (*Database) GetTable

func (d *Database) GetTable(name string) (*Table, error)

func (*Database) ListTables

func (d *Database) ListTables() []*Table

func (*Database) Query

func (d *Database) Query(sql string) (*Query, error)

func (*Database) String

func (d *Database) String() string

type Model

type Model struct {
	Name            string
	Engine          string
	Project         *Project
	Version         float64
	Status          string
	Accuracy        float64
	PredictColumn   string
	UpdateStatus    string
	MindsdbVersion  string
	TrainingOptions map[string]interface{}
	Parameters      map[string]string
}

func (*Model) FineTune

func (m *Model) FineTune(db, query string) (*Model, error)

func (*Model) GetStatus

func (m *Model) GetStatus() bool

func (*Model) Predict

func (m *Model) Predict(predictColumn string, params map[string]string) *ResultSet

func (*Model) Retrain

func (m *Model) Retrain() (*Model, error)

type Project

type Project struct {
	Name   string
	Server *Server
	Api    *connectors.RestAPI
}

func NewProject

func NewProject(server *Server, name string, engine string, params map[string]string) *Project

func (*Project) DropModel

func (p *Project) DropModel(name string) string

func (*Project) GetModel

func (p *Project) GetModel(name string) (*Model, error)

func (*Project) GetView

func (project *Project) GetView(name string) (map[string]interface{}, error)

func (*Project) ListViews

func (project *Project) ListViews() (ResultSet, error)

func (*Project) NewModel

func (p *Project) NewModel(modelName string, predictColumn string, engine string, params map[string]string) (*Model, error)

func (*Project) NewView

func (project *Project) NewView(name string, sql string) *View

func (*Project) Query

func (p *Project) Query(sql, database string) (*Query, error)

type Query

type Query struct {
	Api       *connectors.RestAPI
	Sql       string
	DBName    string
	ResultSet ResultSet
}

func NewQuery

func NewQuery(api *connectors.RestAPI, sql string, dbName string) *Query

type ResultSet

type ResultSet struct {
	Columns []connectors.ColumnType
	Rows    []connectors.Record
}

type Server

type Server struct {
	Api *connectors.RestAPI
}

func NewServer

func NewServer(api *connectors.RestAPI) *Server

func (*Server) CreateProject

func (s *Server) CreateProject(name string) (*Project, error)

func (*Server) DropProject

func (s *Server) DropProject(name string) error

func (*Server) GetDatabase

func (s *Server) GetDatabase(name string) (*Database, error)

func (*Server) GetProject

func (s *Server) GetProject(name string) (*Project, error)

func (*Server) ListDatabases

func (s *Server) ListDatabases() []connectors.ColumnType

func (*Server) ListModels

func (s *Server) ListModels(project string) ([]Model, error)

func (*Server) ListProjects

func (s *Server) ListProjects() []*Project

type Skill

type Skill struct {
	Name        string
	Type        string
	Source      string
	Description string
	Server      *Server
	Api         *connectors.RestAPI
}

func NewSkill

func NewSkill(server *Server, name, stype, source, description string) *Skill

type Table

type Table struct {
	Name string
}

func NewTable

func NewTable(database *Database, name string) *Table

type View

type View struct {
	Project *Project
	Sql     string
	Name    string
}

func (*View) DropView

func (v *View) DropView(name string) string

func (*View) Query

func (view *View) Query(name string) (*Query, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL