Documentation
¶
Index ¶
- Constants
- Variables
- func CheckParentheses(sql string) bool
- func ConvertQuery(sql string) []string
- func DecodeData(data []byte, typeOf int) (any, error)
- func DropDatabase(name string) error
- func EncodeData(data any) ([]byte, error)
- func GetTypeOf(value any) int
- func GlobalLogger() *log.Logger
- func LogTypeToString(t LogType) (string, string)
- func NewColName(funcName string, colNames ...string) string
- func RunClient()
- func RunServer()
- func ShowDatabase() string
- func TrimSpace(str string) string
- type AggregationPlan
- type Client
- type ColVal
- type Column
- type Database
- func (d *Database) Begin() *Transaction
- func (d *Database) Close() error
- func (d *Database) CreateTable(name string) (*Table, error)
- func (d *Database) DropTable(name string) error
- func (d *Database) Query(sql string) (*ResultSet, error)
- func (d *Database) ShowTables() string
- func (d *Database) Update(sql string) error
- type DistinctPlan
- type ExecutePlan
- type FileIO
- type FuncColPlan
- type HavingPlan
- type LimitPlan
- type Line
- type LogLevel
- type LogType
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Flags() int
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) SetFlags(flags int)
- func (l *Logger) SetHighlighting(highlighting bool)
- func (l *Logger) SetLevel(level LogLevel)
- func (l *Logger) SetLevelByString(level string)
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- type LruCache
- type MMap
- type Memtable
- type Option
- type Page
- type Plan
- type ProjectionPlan
- type RenamePlan
- type ResultSet
- type SelectionPlan
- type Server
- type SortingPlan
- type SubTx
- type Table
- type TableReadPlan
- type Transaction
- func (t *Transaction) Commit() error
- func (t *Transaction) CompileQuery(slice []string, wg *sync.WaitGroup) (map[int]Plan, []string, string, error)
- func (t *Transaction) CompileUpdate(sql string) error
- func (t *Transaction) Query(sql string) (*ResultSet, error)
- func (t *Transaction) Rollback() error
- func (t *Transaction) Update(sql string) error
Constants ¶
View Source
const ( KIB MIB GIB )
View Source
const ( BOOL = iota INT64 FLOAT64 STRING DATE )
View Source
const ( LogFatal = LogType(0x1) LogError = LogType(0x2) LogWarning = LogType(0x4) LogInfo = LogType(0x8) LogDebug = LogType(0x10) )
View Source
const ( LogLevelNone = LogLevel(0x0) LogLevelFatal = LogLevelNone | LogLevel(LogFatal) LogLevelError = LogLevelFatal | LogLevel(LogError) LogLevelWarn = LogLevelError | LogLevel(LogWarning) LogLevelInfo = LogLevelWarn | LogLevel(LogInfo) LogLevelDebug = LogLevelInfo | LogLevel(LogDebug) LogLevelAll = LogLevelDebug )
View Source
const ( Standard = iota MMapMode )
View Source
const ( TableRead = iota Projection Selection Aggregation FuncCol Execute Rename Having Distinct Sorting Limit )
Variables ¶
View Source
var ( GlobalOption = &Option{ Root: "E:\\golangProject\\demo2\\dbtest", IOMode: Standard, CondiFuncs: make(map[string]func([]any) bool, 64), ColFuncs: make(map[string]func(any) any, 64), AggFuncs: make(map[string]func([]any) any, 64), ExecFuncs: make(map[string]func([]any) any, 64), MmapSize: 16 * MIB, MaxPage: 4, MaxLine: 4, } )
Functions ¶
func CheckParentheses ¶
func ConvertQuery ¶
func DropDatabase ¶
func EncodeData ¶
func GlobalLogger ¶
func LogTypeToString ¶
func NewColName ¶
func ShowDatabase ¶
func ShowDatabase() string
Types ¶
type AggregationPlan ¶
type AggregationPlan struct {
// contains filtered or unexported fields
}
type Database ¶
type Database struct {
CondiFuncs map[string]func([]any) bool
ColFuncs map[string]func(any) any
AggFuncs map[string]func([]any) any
ExecFuncs map[string]func([]any) any
// contains filtered or unexported fields
}
func CreateDatabase ¶
func UseDatabase ¶
func (*Database) Begin ¶
func (d *Database) Begin() *Transaction
func (*Database) ShowTables ¶
type DistinctPlan ¶
type DistinctPlan struct {
// contains filtered or unexported fields
}
type ExecutePlan ¶
type ExecutePlan struct {
// contains filtered or unexported fields
}
type FileIO ¶
type FuncColPlan ¶
type FuncColPlan struct {
// contains filtered or unexported fields
}
type HavingPlan ¶
type HavingPlan struct {
// contains filtered or unexported fields
}
type LogLevel ¶
type LogLevel int
func GetLogLevel ¶
func GetLogLevel() LogLevel
func StringToLogLevel ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) SetHighlighting ¶
func (*Logger) SetLevelByString ¶
type Option ¶
type Page ¶
func (*Page) DecodeLine ¶
func (*Page) DecodePage ¶
func (*Page) EncodeLine ¶
func (*Page) EncodePage ¶
func (*Page) InsertLine ¶
type ProjectionPlan ¶
type ProjectionPlan struct {
// contains filtered or unexported fields
}
type RenamePlan ¶
type RenamePlan struct {
// contains filtered or unexported fields
}
type SelectionPlan ¶
type SelectionPlan struct {
// contains filtered or unexported fields
}
type SortingPlan ¶
type SortingPlan struct {
// contains filtered or unexported fields
}
type Table ¶
type TableReadPlan ¶
type TableReadPlan struct {
// contains filtered or unexported fields
}
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) CompileQuery ¶
func (*Transaction) CompileUpdate ¶
func (t *Transaction) CompileUpdate(sql string) error
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback() error
func (*Transaction) Update ¶
func (t *Transaction) Update(sql string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.