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
+10 -1
View File
@@ -5,7 +5,7 @@ import (
"database/sql"
"sync"
"git.fsdpf.net/go/db/v2/exec"
"git.fsdpf.net/go/db/exec"
)
type (
@@ -432,6 +432,9 @@ type (
Tx SQLTx
qf exec.QueryFactory
qfOnce sync.Once
// [fix] commands out of sync. Did you run multiple statements at once?
mu sync.Mutex
}
)
@@ -496,6 +499,9 @@ func (td *TxDatabase) Exec(query string, args ...interface{}) (sql.Result, error
// See Database#ExecContext
func (td *TxDatabase) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
td.mu.Lock()
defer td.mu.Unlock()
td.Trace("EXEC", query, args...)
return td.Tx.ExecContext(ctx, query, args...)
}
@@ -518,6 +524,9 @@ func (td *TxDatabase) Query(query string, args ...interface{}) (*sql.Rows, error
// See Database#QueryContext
func (td *TxDatabase) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) {
td.mu.Lock()
defer td.mu.Unlock()
td.Trace("QUERY", query, args...)
return td.Tx.QueryContext(ctx, query, args...)
}