Documentation
¶
Index ¶
- Variables
- func InitVecDB(dbPath string) error
- func Migrate(ds *SQLite, m Migration) error
- func MigrateToLatest(vm VersionManager, ds *SQLite) error
- func RegisterMigration(m Migration)
- type LocalTimePlugin
- type Migration
- type MigrationV1
- type MigrationV2
- type MigrationV3
- type MigrationV4
- type MigrationV5
- type MigrationV6
- type MigrationV7
- type SQLite
- func (ds *SQLite) Add(ctx context.Context, entity datastore.Entity) error
- func (ds *SQLite) BatchAdd(ctx context.Context, entities []datastore.Entity) error
- func (ds *SQLite) Commit(ctx context.Context) error
- func (ds *SQLite) Count(ctx context.Context, entity datastore.Entity, options *datastore.FilterOptions) (int64, error)
- func (ds *SQLite) Delete(ctx context.Context, entity datastore.Entity) error
- func (ds *SQLite) Get(ctx context.Context, entity datastore.Entity) error
- func (ds *SQLite) GetDB() *gorm.DB
- func (ds *SQLite) Init() error
- func (ds *SQLite) IsExist(ctx context.Context, entity datastore.Entity) (bool, error)
- func (ds *SQLite) List(ctx context.Context, entity datastore.Entity, options *datastore.ListOptions) ([]datastore.Entity, error)
- func (ds *SQLite) Put(ctx context.Context, entity datastore.Entity) error
- type SQLiteVersionManager
- type VectorDBVec
- func (vdb *VectorDBVec) Close() error
- func (vdb *VectorDBVec) DeleteChunks(ctx context.Context, chunkIDs []string) error
- func (vdb *VectorDBVec) GetChunkByID(ctx context.Context, id string) (content string, chunkID string, err error)
- func (vdb *VectorDBVec) Initialize() error
- func (vdb *VectorDBVec) SearchSimilarChunks(ctx context.Context, query []float32, limit int, fileIDList []string) ([]string, []float64, error)
- func (vdb *VectorDBVec) SearchSimilarChunksByText(ctx context.Context, queryText string, limit int, fileIDList []string) ([]string, []float64, error)
- type VersionManager
Constants ¶
This section is empty.
Variables ¶
var ( VecDB *VectorDBVec VecInitialized bool VecMutex sync.Mutex )
VEC相关全局变量
Functions ¶
Types ¶
type LocalTimePlugin ¶ added in v0.7.0
type LocalTimePlugin struct{}
LocalTimePlugin is a GORM plugin for automatically setting LocalTime type timestamp fields
func (*LocalTimePlugin) Initialize ¶ added in v0.7.0
func (p *LocalTimePlugin) Initialize(db *gorm.DB) error
Initialize initializes the plugin and registers callbacks
func (*LocalTimePlugin) Name ¶ added in v0.7.0
func (p *LocalTimePlugin) Name() string
Name returns the plugin name
type MigrationV1 ¶
type MigrationV1 struct{}
MigrationV1 example
func (*MigrationV1) ExtraDataOperation ¶
func (m *MigrationV1) ExtraDataOperation(ds *SQLite) error
func (*MigrationV1) GetModifyFields ¶
func (m *MigrationV1) GetModifyFields(tableName string) map[string]string
func (*MigrationV1) Version ¶
func (m *MigrationV1) Version() string
The version should match the corresponding AOG version.
type MigrationV2 ¶
type MigrationV2 struct{}
MigrationV1 example
func (*MigrationV2) ExtraDataOperation ¶
func (m *MigrationV2) ExtraDataOperation(ds *SQLite) error
func (*MigrationV2) GetModifyFields ¶
func (m *MigrationV2) GetModifyFields(tableName string) map[string]string
func (*MigrationV2) Version ¶
func (m *MigrationV2) Version() string
type MigrationV3 ¶
type MigrationV3 struct{}
MigrationV1 example
func (*MigrationV3) ExtraDataOperation ¶
func (m *MigrationV3) ExtraDataOperation(ds *SQLite) error
func (*MigrationV3) GetModifyFields ¶
func (m *MigrationV3) GetModifyFields(tableName string) map[string]string
func (*MigrationV3) Version ¶
func (m *MigrationV3) Version() string
type MigrationV4 ¶
type MigrationV4 struct{}
MigrationV1 example
func (*MigrationV4) ExtraDataOperation ¶
func (m *MigrationV4) ExtraDataOperation(ds *SQLite) error
func (*MigrationV4) GetModifyFields ¶
func (m *MigrationV4) GetModifyFields(tableName string) map[string]string
func (*MigrationV4) Version ¶
func (m *MigrationV4) Version() string
type MigrationV5 ¶
type MigrationV5 struct{}
MigrationV1 example
func (*MigrationV5) ExtraDataOperation ¶
func (m *MigrationV5) ExtraDataOperation(ds *SQLite) error
func (*MigrationV5) GetModifyFields ¶
func (m *MigrationV5) GetModifyFields(tableName string) map[string]string
func (*MigrationV5) Version ¶
func (m *MigrationV5) Version() string
type MigrationV6 ¶ added in v0.7.0
type MigrationV6 struct{} // Phase 3: Plugin support
MigrationV1 example
func (*MigrationV6) ExtraDataOperation ¶ added in v0.7.0
func (m *MigrationV6) ExtraDataOperation(ds *SQLite) error
func (*MigrationV6) GetModifyFields ¶ added in v0.7.0
func (m *MigrationV6) GetModifyFields(tableName string) map[string]string
MigrationV6: Phase 3 Plugin support Add plugin-related fields and tables
func (*MigrationV6) Version ¶ added in v0.7.0
func (m *MigrationV6) Version() string
type MigrationV7 ¶ added in v0.7.0
type MigrationV7 struct{} // text-to-image migration from gRPC to HTTP
MigrationV1 example
func (*MigrationV7) ExtraDataOperation ¶ added in v0.7.0
func (m *MigrationV7) ExtraDataOperation(ds *SQLite) error
func (*MigrationV7) GetModifyFields ¶ added in v0.7.0
func (m *MigrationV7) GetModifyFields(tableName string) map[string]string
MigrationV7: text-to-image service migration from gRPC to HTTP
func (*MigrationV7) Version ¶ added in v0.7.0
func (m *MigrationV7) Version() string
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
SQLite implements the Datastore interface
func (*SQLite) Count ¶
func (ds *SQLite) Count(ctx context.Context, entity datastore.Entity, options *datastore.FilterOptions) (int64, error)
Count counts the number of records
func (*SQLite) GetDB ¶ added in v0.6.0
GetDB exposes the underlying *gorm.DB for advanced queries (e.g., vector search)
type SQLiteVersionManager ¶
type SQLiteVersionManager struct {
// contains filtered or unexported fields
}
SQLiteVersionManager 实现 VersionManager 接口,基于 version_update_record 表
func NewSQLiteVersionManager ¶
func NewSQLiteVersionManager(ds *SQLite) *SQLiteVersionManager
func (*SQLiteVersionManager) GetCurrentVersion ¶
func (vm *SQLiteVersionManager) GetCurrentVersion() (string, error)
func (*SQLiteVersionManager) SetCurrentVersion ¶
func (vm *SQLiteVersionManager) SetCurrentVersion(version string) error
type VectorDBVec ¶ added in v0.6.0
type VectorDBVec struct {
// contains filtered or unexported fields
}
func NewVectorDBVec ¶ added in v0.6.0
func NewVectorDBVec(dbPath string) (*VectorDBVec, error)
func (*VectorDBVec) Close ¶ added in v0.6.0
func (vdb *VectorDBVec) Close() error
Close 关闭数据库连接并释放资源
func (*VectorDBVec) DeleteChunks ¶ added in v0.6.0
func (vdb *VectorDBVec) DeleteChunks(ctx context.Context, chunkIDs []string) error
DeleteChunks 从数据库中删除指定ID的文件块
func (*VectorDBVec) GetChunkByID ¶ added in v0.6.0
func (vdb *VectorDBVec) GetChunkByID(ctx context.Context, id string) (content string, chunkID string, err error)
GetChunkByID 通过主键 id 精确查询 file_chunks 内容
func (*VectorDBVec) Initialize ¶ added in v0.6.0
func (vdb *VectorDBVec) Initialize() error
Initialize 初始化向量数据库结构