Documentation
¶
Index ¶
- Constants
- func ShouldInvalidate(err error) bool
- type Cache
- func (c *Cache) Close() error
- func (c *Cache) GetSchema(databaseID string) (*types.Database, error)
- func (c *Cache) InvalidateAll() error
- func (c *Cache) InvalidateSchema(databaseID string) error
- func (c *Cache) IsExpired(databaseID string) bool
- func (c *Cache) SetSchema(databaseID string, db *types.Database) error
Constants ¶
View Source
const SchemaTTL = 1 * time.Hour
SchemaTTL is how long a cached schema remains valid.
Variables ¶
This section is empty.
Functions ¶
func ShouldInvalidate ¶
ShouldInvalidate checks if an error indicates the schema has changed. Returns true for validation_error codes with schema-mismatch messages.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides schema caching backed by SQLite.
func (*Cache) GetSchema ¶
GetSchema retrieves a cached database schema. Returns nil if not found or expired.
func (*Cache) InvalidateAll ¶
InvalidateAll clears all cached schemas.
func (*Cache) InvalidateSchema ¶
InvalidateSchema removes a cached schema by database ID.
Click to show internal directories.
Click to hide internal directories.