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:
2025-09-27 15:47:28 +08:00
co-authored by Claude
parent 764eccfafd
commit 304d553b3c
113 changed files with 914 additions and 432 deletions
+19
View File
@@ -1,11 +1,19 @@
package engine
import (
"database/sql"
"fmt"
"net/url"
"time"
"github.com/mattn/go-sqlite3"
)
type MockDBConfig struct {
Driver string
Mock *sql.DB
}
// DBConfig 数据库配置结构体
type DBConfig struct {
Driver string
@@ -48,6 +56,7 @@ type DBConfig struct {
Synchronous int
Cache string
BusyTimeout int
Raw func(*sqlite3.SQLiteConn) error
}
SQLServer struct {
@@ -379,6 +388,16 @@ func WithSQLiteFile(file string) Option {
}
}
// SQLite 注册函数
func WithSQLiteRaw(raw func(*sqlite3.SQLiteConn) error) Option {
return func(c *DBConfig) {
if c.Driver != "sqlite3" {
panic("WithSQLiteRegFn is only valid for sqlite3 driver")
}
c.SQLite.Raw = raw
}
}
func WithSQLiteJournal(journal string) Option {
return func(c *DBConfig) {
if c.Driver != "sqlite3" {