core

package
v2.13.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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 Database

type Database struct {
	Name string `json:"name"`
}

type Identity

type Identity struct {
	Name  string
	Email string
}

type Table

type Table struct {
	Database string   `json:"database"`
	Name     string   `json:"name"`
	Columns  []Column `json:"columns"`
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL