docs: Add CLAUDE.md with codebase guidance
Create comprehensive documentation for future Claude Code instances working in this repository, including: - Development commands for testing, building, and code quality - Core architecture overview of the SQL query builder system - Directory structure and component explanations - Testing patterns and conventions - Key dependencies and their purposes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+9
-2
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"git.fsdpf.net/go/db/v2/internal/util"
|
||||
"git.fsdpf.net/go/db/internal/util"
|
||||
)
|
||||
|
||||
type columnList struct {
|
||||
@@ -23,7 +23,8 @@ func NewColumnListExpression(vals ...interface{}) ColumnListExpression {
|
||||
case Expression:
|
||||
cols = append(cols, t)
|
||||
default:
|
||||
_, valKind := util.GetTypeInfo(val, reflect.Indirect(reflect.ValueOf(val)))
|
||||
refVal := reflect.Indirect(reflect.ValueOf(val))
|
||||
_, valKind := util.GetTypeInfo(val, refVal)
|
||||
|
||||
if valKind == reflect.Struct {
|
||||
cm, err := util.GetColumnMap(val)
|
||||
@@ -39,6 +40,12 @@ func NewColumnListExpression(vals ...interface{}) ColumnListExpression {
|
||||
}
|
||||
cols = append(cols, sc)
|
||||
}
|
||||
} else if refVal.Kind() == reflect.Slice {
|
||||
items := make([]any, refVal.Len())
|
||||
for i := 0; i < refVal.Len(); i++ {
|
||||
items[i] = refVal.Index(i).Interface()
|
||||
}
|
||||
return NewColumnListExpression(items...)
|
||||
} else {
|
||||
panic(fmt.Sprintf("Cannot create expression from %+v", val))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user