Documentation ¶
Index ¶
- Constants
- func GetStorageUnitModel(unit StorageUnit) *model.StorageUnit
- type ChatMessage
- type Column
- type Credentials
- type DatabaseType
- type Engine
- type ExternalModel
- type GetRowsResult
- type GraphUnit
- type GraphUnitRelationship
- type GraphUnitRelationshipType
- type Plugin
- type PluginConfig
- type PluginFunctions
- type Record
- type StorageUnit
Constants ¶
View Source
const ( DatabaseType_Postgres = "Postgres" DatabaseType_MySQL = "MySQL" DatabaseType_MariaDB = "MariaDB" DatabaseType_Sqlite3 = "Sqlite3" DatabaseType_MongoDB = "MongoDB" DatabaseType_Redis = "Redis" DatabaseType_ElasticSearch = "ElasticSearch" )
View Source
const ( GraphUnitRelationshipType_OneToOne = "OneToOne" GraphUnitRelationshipType_OneToMany = "OneToMany" GraphUnitRelationshipType_ManyToOne = "ManyToOne" GraphUnitRelationshipType_ManyToMany = "ManyToMany" GraphUnitRelationshipType_Unknown = "Unknown" )
Variables ¶
This section is empty.
Functions ¶
func GetStorageUnitModel ¶
func GetStorageUnitModel(unit StorageUnit) *model.StorageUnit
Types ¶
type ChatMessage ¶
type ChatMessage struct { Type string Result *GetRowsResult Text string }
type Credentials ¶
type DatabaseType ¶
type DatabaseType string
type Engine ¶
type Engine struct {
Plugins []*Plugin
}
func (*Engine) Choose ¶
func (e *Engine) Choose(databaseType DatabaseType) *Plugin
func (*Engine) RegistryPlugin ¶
type ExternalModel ¶
type GetRowsResult ¶
type GraphUnit ¶
type GraphUnit struct { Unit StorageUnit Relations []GraphUnitRelationship }
type GraphUnitRelationship ¶
type GraphUnitRelationship struct { Name string RelationshipType GraphUnitRelationshipType }
type GraphUnitRelationshipType ¶
type GraphUnitRelationshipType string
type Plugin ¶
type Plugin struct { PluginFunctions Type DatabaseType }
type PluginConfig ¶
type PluginConfig struct { Credentials *Credentials ExternalModel *ExternalModel }
func NewPluginConfig ¶
func NewPluginConfig(credentials *Credentials) *PluginConfig
type PluginFunctions ¶
type PluginFunctions interface { GetDatabases(config *PluginConfig) ([]string, error) IsAvailable(config *PluginConfig) bool GetSchema(config *PluginConfig) ([]string, error) GetStorageUnits(config *PluginConfig, schema string) ([]StorageUnit, error) AddStorageUnit(config *PluginConfig, schema string, storageUnit string, fields map[string]string) (bool, error) UpdateStorageUnit(config *PluginConfig, schema string, storageUnit string, values map[string]string) (bool, error) AddRow(config *PluginConfig, schema string, storageUnit string, values []Record) (bool, error) DeleteRow(config *PluginConfig, schema string, storageUnit string, values map[string]string) (bool, error) GetRows(config *PluginConfig, schema string, storageUnit string, where string, pageSize int, pageOffset int) (*GetRowsResult, error) GetGraph(config *PluginConfig, schema string) ([]GraphUnit, error) RawExecute(config *PluginConfig, query string) (*GetRowsResult, error) Chat(config *PluginConfig, schema string, model string, previousConversation string, query string) ([]*ChatMessage, error) }
type StorageUnit ¶
Click to show internal directories.
Click to hide internal directories.