Documentation
¶
Index ¶
- func LoadMasterKey(dataDir string, engine Engine) ([]byte, error)
- type BackupManifest
- type Config
- type Engine
- type Store
- func (s *Store) APIKeyByHash(hash string) (core.APIKey, error)
- func (s *Store) APIKeys() core.APIKeyStore
- func (s *Store) AcquireLease(ctx context.Context, name, owner string, ttl time.Duration) (bool, error)
- func (s *Store) AddLineage(edge core.LineageEdge) error
- func (s *Store) AddMember(groupID, userID string) error
- func (s *Store) AlertByID(id string) (core.Alert, error)
- func (s *Store) Alerts() core.AlertStore
- func (s *Store) Bookmarks() core.BookmarkStore
- func (s *Store) ByEmail(email string) (core.User, error)
- func (s *Store) ByID(id string) (core.User, error)
- func (s *Store) Close() error
- func (s *Store) CollectionByID(id string) (core.Collection, error)
- func (s *Store) Collections() core.CollectionStore
- func (s *Store) ConnectionSecrets(key []byte) (core.ConnectionSecretStore, error)
- func (s *Store) Create(user core.User) error
- func (s *Store) CreateAPIKey(key core.APIKey) error
- func (s *Store) CreateAlert(a core.Alert) error
- func (s *Store) CreateBookmark(b core.Bookmark) error
- func (s *Store) CreateCollection(c core.Collection) error
- func (s *Store) CreateDashboard(d core.Dashboard) error
- func (s *Store) CreateGlossary(term core.GlossaryTerm) error
- func (s *Store) CreateGroup(group core.Group) error
- func (s *Store) CreateMetric(m core.Metric) error
- func (s *Store) CreateModel(m core.Model) error
- func (s *Store) CreateNotification(n core.Notification) error
- func (s *Store) CreateQuestion(q core.Question) error
- func (s *Store) CreateRevision(r core.Revision) error
- func (s *Store) CreateRun(item core.Run) error
- func (s *Store) CreateSchedule(item core.Schedule) error
- func (s *Store) CreateSegment(seg core.Segment) error
- func (s *Store) CreateSession(session core.Session) error
- func (s *Store) CreateSubscription(item core.Subscription) error
- func (s *Store) DashboardByID(id string) (core.Dashboard, error)
- func (s *Store) DashboardByPublicUUID(uuid string) (core.Dashboard, error)
- func (s *Store) Dashboards() core.DashboardStore
- func (s *Store) Delete(id string) error
- func (s *Store) DeleteAPIKey(id string) error
- func (s *Store) DeleteAlert(id string) error
- func (s *Store) DeleteBookmark(id, userID string) error
- func (s *Store) DeleteCollection(id string) error
- func (s *Store) DeleteExpired(now time.Time) error
- func (s *Store) DeleteSession(id string) error
- func (s *Store) DeleteSnapshot(databaseID string) error
- func (s *Store) DeleteSubscription(id string) error
- func (s *Store) DeleteUploadedTable(id string) error
- func (s *Store) Engine() Engine
- func (s *Store) ExportLogical(ctx context.Context, writer io.Writer, version string) (BackupManifest, error)
- func (s *Store) Fields() core.FieldStore
- func (s *Store) Get(key string) (string, bool, error)
- func (s *Store) GetSnapshot(databaseID string) (core.SchemaSnapshot, error)
- func (s *Store) GetTableAnnotation(databaseID, schema, table string) (core.TableAnnotation, error)
- func (s *Store) Glossary() core.GlossaryStore
- func (s *Store) Groups() core.GroupStore
- func (s *Store) GroupsForUser(userID string) ([]core.Group, error)
- func (s *Store) HasMember(groupID, userID string) (bool, error)
- func (s *Store) ImportCatalog(items []core.Database) error
- func (s *Store) IsCollectionSharedWith(collectionID, userID string) (bool, error)
- func (s *Store) Lineage() core.LineageStore
- func (s *Store) List() ([]core.Database, error)
- func (s *Store) ListAPIKeys(userID string) ([]core.APIKey, error)
- func (s *Store) ListAlerts() ([]core.Alert, error)
- func (s *Store) ListAllAPIKeys() ([]core.APIKey, error)
- func (s *Store) ListAllNotifications() ([]core.Notification, error)
- func (s *Store) ListBookmarks(userID string) ([]core.Bookmark, error)
- func (s *Store) ListCollectionShares(collectionID string) ([]core.CollectionShare, error)
- func (s *Store) ListCollections() ([]core.Collection, error)
- func (s *Store) ListDashboards(includeArchived bool) ([]core.Dashboard, error)
- func (s *Store) ListDatabaseFields(databaseID string) ([]core.FieldMeta, error)
- func (s *Store) ListFields(databaseID, schema, table string) ([]core.FieldMeta, error)
- func (s *Store) ListGlossary() ([]core.GlossaryTerm, error)
- func (s *Store) ListGroups() ([]core.Group, error)
- func (s *Store) ListLineage(entityType, id string) ([]core.LineageEdge, error)
- func (s *Store) ListMaterializedTables() ([]core.MaterializedTable, error)
- func (s *Store) ListMaterializedTablesByDatabase(databaseID string) ([]core.MaterializedTable, error)
- func (s *Store) ListMetrics() ([]core.Metric, error)
- func (s *Store) ListModels() ([]core.Model, error)
- func (s *Store) ListNotifications(userID string) ([]core.Notification, error)
- func (s *Store) ListQuestions(includeArchived bool) ([]core.Question, error)
- func (s *Store) ListRevisions(targetType, targetID string) ([]core.Revision, error)
- func (s *Store) ListRuns(scheduleID string) ([]core.Run, error)
- func (s *Store) ListScheduleSummaries() ([]core.ScheduleSummary, error)
- func (s *Store) ListSchedules() ([]core.Schedule, error)
- func (s *Store) ListSegments() ([]core.Segment, error)
- func (s *Store) ListSubscriptions() ([]core.Subscription, error)
- func (s *Store) ListSubscriptionsByDashboard(dashboardID string) ([]core.Subscription, error)
- func (s *Store) ListUploadedTables() ([]core.UploadedTable, error)
- func (s *Store) ListUsers() ([]core.User, error)
- func (s *Store) Materialized() core.MaterializedTableStore
- func (s *Store) MaterializedTableByTarget(databaseID, schema, name string) (core.MaterializedTable, error)
- func (s *Store) MetricByID(id string) (core.Metric, error)
- func (s *Store) Metrics() core.MetricStore
- func (s *Store) MigrateSQLiteToProduction(ctx context.Context, targetConfig Config) (TransferReport, error)
- func (s *Store) ModelByID(id string) (core.Model, error)
- func (s *Store) Models() core.ModelStore
- func (s *Store) Notifications() core.NotificationStore
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) PreviewUploadedTable(ctx context.Context, id string) (core.UploadedTablePreview, error)
- func (s *Store) ProductionMigrationCompleted() (bool, string, error)
- func (s *Store) PublicDashboardAccess(ctx context.Context, uuid string) (core.DashboardPublicAccess, error)
- func (s *Store) PublicDashboardPageAvailable(ctx context.Context, uuid string, embed bool) (bool, error)
- func (s *Store) QuestionByID(id string) (core.Question, error)
- func (s *Store) Questions() core.QuestionStore
- func (s *Store) ReleaseLease(ctx context.Context, name, owner string) error
- func (s *Store) ReplaceCollectionShares(collectionID string, userIDs []string) error
- func (s *Store) ReplaceMembers(groupID string, userIDs []string) error
- func (s *Store) Revisions() core.RevisionStore
- func (s *Store) Runs() core.RunStore
- func (s *Store) Save(database core.Database) error
- func (s *Store) SaveField(field core.FieldMeta) error
- func (s *Store) SaveSnapshot(item core.SchemaSnapshot) error
- func (s *Store) SaveTableAnnotation(databaseID, schema, table string, annotation core.TableAnnotation) error
- func (s *Store) SaveUploadedTable(item core.UploadedTable, rows [][]string) error
- func (s *Store) ScheduleByID(id string) (core.Schedule, error)
- func (s *Store) Schedules() core.ScheduleStore
- func (s *Store) SchemaVersion() int
- func (s *Store) Search(query string) ([]core.SearchHit, error)
- func (s *Store) SegmentByID(id string) (core.Segment, error)
- func (s *Store) Segments() core.SegmentStore
- func (s *Store) SessionByID(id string) (core.Session, error)
- func (s *Store) Sessions() core.SessionStore
- func (s *Store) Set(key, value string) error
- func (s *Store) SetActive(id string, active bool) error
- func (s *Store) SetDashboardArchived(id string, archivedAt *time.Time) error
- func (s *Store) SetPassword(id, passwordHash string) error
- func (s *Store) SetQuestionArchived(id string, archivedAt *time.Time) error
- func (s *Store) SubscriptionByID(id string) (core.Subscription, error)
- func (s *Store) Subscriptions() core.SubscriptionStore
- func (s *Store) UpdateAlert(a core.Alert) error
- func (s *Store) UpdateCollection(c core.Collection) error
- func (s *Store) UpdateDashboard(d core.Dashboard) error
- func (s *Store) UpdateModel(m core.Model) error
- func (s *Store) UpdateQuestion(q core.Question) error
- func (s *Store) UpdateRun(item core.Run) error
- func (s *Store) UpdateSchedule(item core.Schedule) error
- func (s *Store) UpdateSubscription(item core.Subscription) error
- func (s *Store) UpdateUserProfile(id, name, email, locale, theme, avatarURL string) error
- func (s *Store) UpsertGroup(group core.Group) error
- func (s *Store) UpsertMaterializedTable(item core.MaterializedTable) error
- func (s *Store) UserByFeishuOpenID(openID string) (core.User, error)
- func (s *Store) Users() core.UserStore
- type TransferReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackupManifest ¶
type Config ¶
type Config struct {
Engine Engine
DSN string
Path string
Host string
Port int
Database string
Schema string
Username string
Password string
TLSMode string
CAFile string
AppVersion string
ConnectTimeout time.Duration
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime time.Duration
}
func ConfigFromEnv ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func OpenConfig ¶
func OpenWithVersion ¶
func (*Store) APIKeys ¶
func (s *Store) APIKeys() core.APIKeyStore
func (*Store) AcquireLease ¶
func (*Store) AddLineage ¶
func (s *Store) AddLineage(edge core.LineageEdge) error
func (*Store) Alerts ¶
func (s *Store) Alerts() core.AlertStore
func (*Store) Bookmarks ¶
func (s *Store) Bookmarks() core.BookmarkStore
func (*Store) CollectionByID ¶
func (s *Store) CollectionByID(id string) (core.Collection, error)
func (*Store) Collections ¶
func (s *Store) Collections() core.CollectionStore
func (*Store) ConnectionSecrets ¶
func (s *Store) ConnectionSecrets(key []byte) (core.ConnectionSecretStore, error)
func (*Store) CreateCollection ¶
func (s *Store) CreateCollection(c core.Collection) error
func (*Store) CreateGlossary ¶
func (s *Store) CreateGlossary(term core.GlossaryTerm) error
func (*Store) CreateNotification ¶
func (s *Store) CreateNotification(n core.Notification) error
func (*Store) CreateSubscription ¶
func (s *Store) CreateSubscription(item core.Subscription) error
func (*Store) DashboardByPublicUUID ¶
func (*Store) Dashboards ¶
func (s *Store) Dashboards() core.DashboardStore
func (*Store) DeleteAPIKey ¶
func (*Store) DeleteAlert ¶
func (*Store) DeleteBookmark ¶
func (*Store) DeleteCollection ¶
func (*Store) DeleteSession ¶
func (*Store) DeleteSnapshot ¶
func (*Store) DeleteSubscription ¶
func (*Store) DeleteUploadedTable ¶
func (*Store) ExportLogical ¶
func (s *Store) ExportLogical(ctx context.Context, writer io.Writer, version string) (BackupManifest, error)
ExportLogical writes a consistent, engine-neutral ZIP. Each table is a JSONL stream whose first row declares columns; remaining rows contain values.
func (*Store) Fields ¶
func (s *Store) Fields() core.FieldStore
func (*Store) GetSnapshot ¶
func (s *Store) GetSnapshot(databaseID string) (core.SchemaSnapshot, error)
func (*Store) GetTableAnnotation ¶
func (s *Store) GetTableAnnotation(databaseID, schema, table string) (core.TableAnnotation, error)
func (*Store) Glossary ¶
func (s *Store) Glossary() core.GlossaryStore
func (*Store) Groups ¶
func (s *Store) Groups() core.GroupStore
func (*Store) IsCollectionSharedWith ¶
func (*Store) Lineage ¶
func (s *Store) Lineage() core.LineageStore
func (*Store) ListAllNotifications ¶
func (s *Store) ListAllNotifications() ([]core.Notification, error)
func (*Store) ListCollectionShares ¶
func (s *Store) ListCollectionShares(collectionID string) ([]core.CollectionShare, error)
func (*Store) ListCollections ¶
func (s *Store) ListCollections() ([]core.Collection, error)
func (*Store) ListDashboards ¶
func (*Store) ListDatabaseFields ¶
func (*Store) ListFields ¶
func (*Store) ListGlossary ¶
func (s *Store) ListGlossary() ([]core.GlossaryTerm, error)
func (*Store) ListLineage ¶
func (s *Store) ListLineage(entityType, id string) ([]core.LineageEdge, error)
func (*Store) ListMaterializedTables ¶
func (s *Store) ListMaterializedTables() ([]core.MaterializedTable, error)
func (*Store) ListMaterializedTablesByDatabase ¶
func (s *Store) ListMaterializedTablesByDatabase(databaseID string) ([]core.MaterializedTable, error)
func (*Store) ListNotifications ¶
func (s *Store) ListNotifications(userID string) ([]core.Notification, error)
func (*Store) ListQuestions ¶
func (*Store) ListRevisions ¶
func (*Store) ListScheduleSummaries ¶
func (s *Store) ListScheduleSummaries() ([]core.ScheduleSummary, error)
ListScheduleSummaries reads one indexed run per plan, including plans that have never produced a materialized table. Compiled SQL stays in run history.
func (*Store) ListSubscriptions ¶
func (s *Store) ListSubscriptions() ([]core.Subscription, error)
func (*Store) ListSubscriptionsByDashboard ¶
func (s *Store) ListSubscriptionsByDashboard(dashboardID string) ([]core.Subscription, error)
func (*Store) ListUploadedTables ¶
func (s *Store) ListUploadedTables() ([]core.UploadedTable, error)
func (*Store) Materialized ¶
func (s *Store) Materialized() core.MaterializedTableStore
func (*Store) MaterializedTableByTarget ¶
func (s *Store) MaterializedTableByTarget(databaseID, schema, name string) (core.MaterializedTable, error)
func (*Store) Metrics ¶
func (s *Store) Metrics() core.MetricStore
func (*Store) MigrateSQLiteToProduction ¶
func (s *Store) MigrateSQLiteToProduction(ctx context.Context, targetConfig Config) (TransferReport, error)
MigrateSQLiteToProduction copies a consistent snapshot into a freshly initialized PostgreSQL or MySQL application database. It never switches the running process; operators must apply the returned configuration and restart.
func (*Store) Models ¶
func (s *Store) Models() core.ModelStore
func (*Store) Notifications ¶
func (s *Store) Notifications() core.NotificationStore
func (*Store) PreviewUploadedTable ¶
func (s *Store) PreviewUploadedTable(ctx context.Context, id string) (core.UploadedTablePreview, error)
Old and new uploads store the sheet as a JSON array. Read a bounded prefix so opening a preview never transfers the full sheet to the server.
func (*Store) ProductionMigrationCompleted ¶
func (*Store) PublicDashboardAccess ¶
func (s *Store) PublicDashboardAccess(ctx context.Context, uuid string) (core.DashboardPublicAccess, error)
PublicDashboardAccess checks access without reading the dashboard's contents. The card and metadata handlers check the same condition when loading the dashboard snapshot used for the request.
func (*Store) PublicDashboardPageAvailable ¶
func (*Store) Questions ¶
func (s *Store) Questions() core.QuestionStore
func (*Store) ReleaseLease ¶
func (*Store) ReplaceCollectionShares ¶
func (*Store) ReplaceMembers ¶
func (*Store) Revisions ¶
func (s *Store) Revisions() core.RevisionStore
func (*Store) SaveSnapshot ¶
func (s *Store) SaveSnapshot(item core.SchemaSnapshot) error
func (*Store) SaveTableAnnotation ¶
func (s *Store) SaveTableAnnotation(databaseID, schema, table string, annotation core.TableAnnotation) error
func (*Store) SaveUploadedTable ¶
func (s *Store) SaveUploadedTable(item core.UploadedTable, rows [][]string) error
func (*Store) Schedules ¶
func (s *Store) Schedules() core.ScheduleStore
func (*Store) SchemaVersion ¶
func (*Store) Segments ¶
func (s *Store) Segments() core.SegmentStore
func (*Store) Sessions ¶
func (s *Store) Sessions() core.SessionStore
func (*Store) SetDashboardArchived ¶
func (*Store) SetPassword ¶
func (*Store) SetQuestionArchived ¶
func (*Store) SubscriptionByID ¶
func (s *Store) SubscriptionByID(id string) (core.Subscription, error)
func (*Store) Subscriptions ¶
func (s *Store) Subscriptions() core.SubscriptionStore
func (*Store) UpdateCollection ¶
func (s *Store) UpdateCollection(c core.Collection) error
func (*Store) UpdateSubscription ¶
func (s *Store) UpdateSubscription(item core.Subscription) error
func (*Store) UpdateUserProfile ¶
func (*Store) UpsertMaterializedTable ¶
func (s *Store) UpsertMaterializedTable(item core.MaterializedTable) error
func (*Store) UserByFeishuOpenID ¶
type TransferReport ¶
type TransferReport struct {
SourceEngine Engine `json:"source_engine"`
TargetEngine Engine `json:"target_engine"`
Tables int `json:"tables"`
Rows int64 `json:"rows"`
RowsByTable map[string]int64 `json:"rows_by_table"`
CompletedAt time.Time `json:"completed_at"`
RestartRequired bool `json:"restart_required"`
}