Documentation
¶
Overview ¶
Package catalog provides catalog management for XxSql storage engine.
Index ¶
- Constants
- type Catalog
- func (c *Catalog) Close() error
- func (c *Catalog) CreateFTSIndex(name, tableName string, columns []string, tokenizer string) error
- func (c *Catalog) CreateTable(name string, columns []*types.ColumnInfo) error
- func (c *Catalog) CreateTrigger(name string, timing, event int, tableName string, granularity int, ...) error
- func (c *Catalog) CreateView(name string, query string, columns []string, checkOption string) error
- func (c *Catalog) DropFTSIndex(name string) error
- func (c *Catalog) DropTable(name string) error
- func (c *Catalog) DropTrigger(name string) error
- func (c *Catalog) DropView(name string) error
- func (c *Catalog) FTSIndexExists(name string) bool
- func (c *Catalog) Flush() error
- func (c *Catalog) GetFTSIndex(name string) (*FTSInfo, error)
- func (c *Catalog) GetFTSIndexesForTable(tableName string) []*FTSInfo
- func (c *Catalog) GetTable(name string) (*table.Table, error)
- func (c *Catalog) GetTableInfos() []*table.TableInfo
- func (c *Catalog) GetTrigger(name string) (*TriggerInfo, error)
- func (c *Catalog) GetTriggersForTable(tableName string, event int) []*TriggerInfo
- func (c *Catalog) GetView(name string) (*ViewInfo, error)
- func (c *Catalog) ListFTSIndexes() []string
- func (c *Catalog) ListTables() []string
- func (c *Catalog) ListTriggers() []string
- func (c *Catalog) ListViews() []string
- func (c *Catalog) Open() error
- func (c *Catalog) RenameTable(oldName, newName string) error
- func (c *Catalog) TableCount() int
- func (c *Catalog) TableExists(name string) bool
- func (c *Catalog) TriggerExists(name string) bool
- func (c *Catalog) ViewExists(name string) bool
- type FTSInfo
- type TriggerInfo
- type ViewInfo
Constants ¶
const (
// CatalogFileName is the name of the catalog file.
CatalogFileName = "catalog.json"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog manages all table metadata.
func (*Catalog) CreateFTSIndex ¶ added in v0.0.5
CreateFTSIndex creates a new FTS index.
func (*Catalog) CreateTable ¶
func (c *Catalog) CreateTable(name string, columns []*types.ColumnInfo) error
CreateTable creates a new table.
func (*Catalog) CreateTrigger ¶ added in v0.0.5
func (c *Catalog) CreateTrigger(name string, timing, event int, tableName string, granularity int, whenClause, body string) error
CreateTrigger creates a new trigger.
func (*Catalog) CreateView ¶ added in v0.0.5
CreateView creates a new view.
func (*Catalog) DropFTSIndex ¶ added in v0.0.5
DropFTSIndex drops an FTS index.
func (*Catalog) DropTrigger ¶ added in v0.0.5
DropTrigger drops a trigger.
func (*Catalog) FTSIndexExists ¶ added in v0.0.5
FTSIndexExists checks if an FTS index exists.
func (*Catalog) GetFTSIndex ¶ added in v0.0.5
GetFTSIndex returns an FTS index by name.
func (*Catalog) GetFTSIndexesForTable ¶ added in v0.0.5
GetFTSIndexesForTable returns all FTS indexes for a table.
func (*Catalog) GetTableInfos ¶
GetTableInfos returns information about all tables.
func (*Catalog) GetTrigger ¶ added in v0.0.5
func (c *Catalog) GetTrigger(name string) (*TriggerInfo, error)
GetTrigger returns a trigger by name.
func (*Catalog) GetTriggersForTable ¶ added in v0.0.5
func (c *Catalog) GetTriggersForTable(tableName string, event int) []*TriggerInfo
GetTriggersForTable returns all triggers for a specific table and event.
func (*Catalog) ListFTSIndexes ¶ added in v0.0.5
ListFTSIndexes returns all FTS index names.
func (*Catalog) ListTables ¶
ListTables returns all table names.
func (*Catalog) ListTriggers ¶ added in v0.0.5
ListTriggers returns all trigger names.
func (*Catalog) RenameTable ¶
RenameTable renames a table.
func (*Catalog) TableCount ¶
TableCount returns the number of tables.
func (*Catalog) TableExists ¶
TableExists checks if a table exists.
func (*Catalog) TriggerExists ¶ added in v0.0.5
TriggerExists checks if a trigger exists.
func (*Catalog) ViewExists ¶ added in v0.0.5
ViewExists checks if a view exists.
type FTSInfo ¶ added in v0.0.5
type FTSInfo struct {
Name string // Index name
TableName string // Table name
Columns []string // Indexed columns
Tokenizer string // Tokenizer type
}
FTSInfo stores FTS index definition.
type TriggerInfo ¶ added in v0.0.5
type TriggerInfo struct {
Name string
Timing int // 0=BEFORE, 1=AFTER, 2=INSTEAD OF
Event int // 0=INSERT, 1=UPDATE, 2=DELETE
TableName string
Granularity int // 0=FOR EACH ROW, 1=FOR EACH STATEMENT
WhenClause string
Body string
}
TriggerInfo stores trigger definition.