Documentation
¶
Overview ¶
Package core provides core types used throughout CommitDB.
The package defines fundamental types like Identity, Database, Table, Column, and associated type constants.
Identity ¶
Identity identifies the author of transactions (Git commit author):
identity := core.Identity{
Name: "John Doe",
Email: "[email protected]",
}
Column Types ¶
Supported column types:
- StringType: Short strings (VARCHAR equivalent)
- TextType: Long text (TEXT equivalent)
- IntType: Integers
- FloatType: Floating point numbers
- BoolType: Boolean values
- TimestampType: Date/time values
Table Definition ¶
table := core.Table{
Database: "mydb",
Name: "users",
Columns: []core.Column{
{Name: "id", Type: core.IntType, PrimaryKey: true},
{Name: "name", Type: core.StringType},
{Name: "active", Type: core.BoolType},
},
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
Name string `json:"name"`
Type ColumnType `json:"type"`
PrimaryKey bool `json:"primaryKey"`
}
type ColumnType ¶
type ColumnType int
const ( StringType ColumnType = iota IntType FloatType BoolType TextType DateType TimestampType JSONType )
type View ¶
type View struct {
Database string `json:"database"`
Name string `json:"name"`
Query string `json:"query"` // The SELECT statement defining the view
Materialized bool `json:"materialized"` // True if this is a materialized view
Columns []Column `json:"columns"` // Inferred column schema
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"` // Last refresh time for materialized views
}
View represents a SQL view (virtual or materialized)
Click to show internal directories.
Click to hide internal directories.