Documentation
¶
Index ¶
- type CSVRecord
- type CSVStore
- func (cs *CSVStore) CheckTableExists(tableName string) bool
- func (cs *CSVStore) CreateTable(tableName string, headers []string) error
- func (cs *CSVStore) Delete(tableName string, conditions []QueryCondition) (*QueryResult, error)
- func (cs *CSVStore) GetTablePath(tableName string) string
- func (cs *CSVStore) Insert(tableName string, record CSVRecord) (CSVRecord, error)
- func (cs *CSVStore) ListTables() ([]string, error)
- func (cs *CSVStore) Query(tableName string, conditions []QueryCondition) (*QueryResult, error)
- func (cs *CSVStore) QuerySortedRange(tableName string, sortField string, sortBy string, limit int) (*QueryResult, error)
- func (cs *CSVStore) Select(tableName string, columns []string, conditions []QueryCondition) (*QueryResult, error)
- func (cs *CSVStore) Update(tableName string, updates CSVRecord, conditions []QueryCondition) (*QueryResult, error)
- type QueryCondition
- type QueryResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSVStore ¶
type CSVStore struct {
// contains filtered or unexported fields
}
CSVStore represents a CSV-based storage system
func NewCSVStore ¶
NewCSVStore creates a new CSV-based storage system
func (*CSVStore) CheckTableExists ¶
CheckTableExists checks if a table exists
func (*CSVStore) CreateTable ¶
CreateTable creates a new CSV table with headers
func (*CSVStore) Delete ¶
func (cs *CSVStore) Delete(tableName string, conditions []QueryCondition) (*QueryResult, error)
Delete removes records matching conditions
func (*CSVStore) GetTablePath ¶
GetTablePath returns the file path for a table (for external access)
func (*CSVStore) ListTables ¶
ListTables returns all available tables
func (*CSVStore) Query ¶
func (cs *CSVStore) Query(tableName string, conditions []QueryCondition) (*QueryResult, error)
Query executes a query on the CSV table
func (*CSVStore) QuerySortedRange ¶
func (cs *CSVStore) QuerySortedRange( tableName string, sortField string, sortBy string, limit int, ) (*QueryResult, error)
QuerySortedRange retrieves a limited number of records from a table, sorted by a specific field. sortBy can be "asc" for ascending or "desc" for descending order. limit specifies the maximum number of records to return. If limit is larger than available records, all records are returned. If limit is negative, an error is returned.
func (*CSVStore) Select ¶
func (cs *CSVStore) Select( tableName string, columns []string, conditions []QueryCondition, ) (*QueryResult, error)
Select retrieves specific columns from query results
func (*CSVStore) Update ¶
func (cs *CSVStore) Update( tableName string, updates CSVRecord, conditions []QueryCondition, ) (*QueryResult, error)
Update updates records matching conditions
type QueryCondition ¶
type QueryCondition struct {
Column string
Operator string // "=", "!=", ">", "<", ">=", "<=", "contains", "starts_with", "ends_with"
Value string
}
QueryCondition represents a filter condition
type QueryResult ¶
QueryResult represents query results