Commit graph

14 commits

Author SHA1 Message Date
4ee1e8d57a 🔧 ADD: ZIG_VERSION_NOTES.md - Referencia sistema notas versiones Zig
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 23:01:16 +01:00
f201b0ded2 docs: complete CLAUDE.md with ecosystem info and docs reference
- Add zcat ecosystem mention (zcatui, zcatgui, zcatsql)
- Add complete docs/ listing
- Add examples reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 02:30:21 +01:00
c5e6cec4a6 refactor: rename zsqlite to zcatsql
Consistent naming with zcat ecosystem (zcatui, zcatgui, zcatsql).
All lowercase per Zig naming conventions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 02:19:52 +01:00
8a9b17c83c docs: update CLAUDE.md with complete project context
- Add audit/ module to architecture
- Include TEAM_STANDARDS normas esenciales
- Add Zig 0.15 compatibility notes
- Reference REFERENCE.md and docs/
- Include workflow and communication guidelines

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 23:14:00 +01:00
6891d6e026 feat: add audit log system with hash chain integrity
- Complete audit logging for INSERT, UPDATE, DELETE operations
- SHA-256 hash chain for tamper detection
- File rotation by size (100MB) and age (30 days)
- Context tracking (user, app, host, pid)
- JSON Lines format output
- verifyChain() for integrity verification
- Comprehensive REFERENCE.md technical documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 22:56:23 +01:00
427628116b docs: optimize CLAUDE.md - reduce from 322 to 69 lines
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 21:06:33 +01:00
fac8bcba62 feat: v1.0 - add row mapping, serialize, session, vacuum into, snapshots
New features:
- Row-to-struct mapping (Row.to(), Row.toAlloc(), Row.freeStruct())
- Serialize/Deserialize API (toBytes, fromBytes, cloneToMemory, etc.)
- Session extension for change tracking (changesets, patchsets, diff)
- VACUUM INTO for creating compacted database copies
- Snapshot API for consistent reads in WAL mode
- Comprehensive README.md documentation

Technical changes:
- Enable -DSQLITE_ENABLE_SESSION and -DSQLITE_ENABLE_SNAPSHOT
- Add c.zig defines for session/snapshot headers
- Fix connection pool test to use temp file instead of shared cache
- 63 tests passing, 7563 lines of code across 15 modules

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 21:04:24 +01:00
167e54530f feat: add advanced features - batch bind, row iterator, FTS5, JSON, R-Tree, virtual tables
New features:
- Batch binding: stmt.bindAll(.{ "Alice", 30, 95.5 }), stmt.rebind()
- Row iterator: stmt.iterator(), Row struct with convenient accessors
- File control: setFileControlInt(), getPersistWal(), setChunkSize()
- FTS5 helpers: Fts5 struct with createSimpleTable(), search(), highlight()
- JSON helpers: Json struct with extract(), set(), createArray(), patch()
- R-Tree helpers: RTree struct with insert2D(), queryIntersects2D(), spatial joins
- Virtual table foundations: vtable.zig with helper types
- BoundingBox2D/3D, GeoCoord with distance calculations

Total: 5861 lines across 13 modules
All 54 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 20:30:10 +01:00
5e28cbe4bf refactor: modularize root.zig into specialized modules
Split monolithic root.zig (4200 lines) into 9 focused modules:
- c.zig: centralized @cImport for SQLite
- errors.zig: Error enum and resultToError
- types.zig: OpenFlags, ColumnType, Limit, enums
- database.zig: Database struct with all methods
- statement.zig: Statement struct with bindings/columns
- functions.zig: UDFs, hooks, and C callbacks
- backup.zig: Backup and Blob I/O
- pool.zig: ConnectionPool (thread-safe)
- root.zig: re-exports + tests (~1100 lines)

Total: ~3600 lines (74% reduction in root.zig)
All 47 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 19:54:19 +01:00
7229c27c80 Fase 4: Window functions, URI, pragmas y connection pool
- Window functions: createWindowFunction() con 4 callbacks
  (xStep, xFinal, xValue, xInverse)
- URI connection string: openUri() y openUriAlloc()
  (file:path?mode=ro&cache=shared)
- Pragmas adicionales: setAutoVacuum, setCacheSize,
  setCaseSensitiveLike, setDeferForeignKeys, setLockingMode,
  setQueryOnly, setRecursiveTriggers, setSecureDelete,
  setPageSize, setMaxPageCount, setTempStore, setWalAutoCheckpoint
- Maintenance: vacuum, incrementalVacuum, optimize,
  integrityCheck, quickCheck, walCheckpoint
- ConnectionPool: pool thread-safe con acquire/release

Paridad 100% con go-sqlite3 (excepto extensiones dinamicas
que estan deshabilitadas por seguridad)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 19:33:46 +01:00
733533ec83 feat(v0.5): Fase 3B - Callbacks avanzados, limits y timestamps
Implementa todas las funcionalidades restantes de la paridad con go-sqlite3:

Callbacks y Hooks:
- Authorizer callback para control de operaciones SQL
- Pre-update hook con acceso a valores antes/despues del cambio
- Progress handler para interrumpir queries largos
- Busy handler personalizado (custom callback)

APIs adicionales:
- Limits API (getLimit/setLimit) para control de limites SQLite
- Column metadata extendida (columnDatabaseName, columnTableName, columnOriginName)
- Expanded SQL (stmt.expandedSql)
- Timestamp binding (bindTimestamp, bindCurrentTime) con formato ISO8601

Build:
- Habilitado SQLITE_ENABLE_PREUPDATE_HOOK en build.zig
- Definido @cDefine en @cImport para exponer APIs opcionales

Tests:
- Tests para authorizer, progress handler, limits, expanded SQL
- Tests para column metadata y pre-update hook
- Tests para timestamp binding

Documentacion actualizada con todos los nuevos APIs y ejemplos.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 18:52:18 +01:00
7742f44667 v0.4: Fase 3A complete - Blob I/O, Hooks, Aggregate Functions
New features:
- Blob I/O: Incremental read/write for large BLOBs
  - Blob.open(), close(), deinit()
  - Blob.read(), write() with offset support
  - Blob.bytes(), reopen(), readAll()
- Hooks: Monitor database changes
  - setCommitHook() - called on transaction commit
  - setRollbackHook() - called on transaction rollback
  - setUpdateHook() - called on INSERT/UPDATE/DELETE
  - clearHooks() - remove all hooks
  - UpdateOperation enum (insert, update, delete)
- Aggregate Functions: Custom multi-row aggregates
  - createAggregateFunction(name, num_args, step_fn, final_fn)
  - AggregateContext with getAggregateContext() for state management
  - Support for setNull/Int/Float/Text/Blob/Error results

Documentation:
- Updated docs/API.md to v0.4 with new features and examples
- Updated docs/CGO_PARITY_ANALYSIS.md - Fase 3A marked complete
- Updated CLAUDE.md to v0.4 with all new implementations

Tests: 28 total (8 new tests for Fase 3A features)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 18:02:01 +01:00
532cf827f8 v0.3: Fase 2A+2B complete - Major feature additions
New features:
- Backup API: Backup struct with step(), progress(), remaining(), pageCount()
- Convenience functions: backupToFile(), loadFromFile(), backupDatabase()
- ATTACH/DETACH: attach(), attachMemory(), detach(), listDatabases()
- User-Defined Functions: createScalarFunction(), FunctionContext, FunctionValue
- Custom Collations: createCollation(), CollationFn, removeCollation()
- Named parameters: bindTextNamed(), bindIntNamed(), etc. (:name, @name, $name)
- Savepoints: savepoint(), release(), rollbackTo()
- Configuration: setBusyTimeout(), setJournalMode(), setSynchronous(), enableWalMode()
- Statement metadata: sql(), isReadOnly(), parameterCount(), parameterIndex()
- Transaction: beginExclusive()
- Utilities: errorCode(), extendedErrorCode(), interrupt(), isReadOnly(), filename()
- Additional bind/column: bindBool(), bindZeroblob(), columnBool(), columnBytes(), columnDeclType()

Documentation:
- Created docs/API.md - Complete API reference
- Created docs/ARCHITECTURE.md - Technical architecture
- Created docs/CGO_PARITY_ANALYSIS.md - Feature parity tracking with go-sqlite3
- Updated CLAUDE.md with all new features

All 20 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 17:54:50 +01:00
a290859182 Initial commit: zsqlite - SQLite wrapper for Zig
- SQLite 3.47.2 amalgamation compiled directly into binary
- Idiomatic Zig API (Database, Statement, errors)
- Full test suite passing
- Basic example with CRUD operations
- Zero runtime dependencies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 16:45:28 +01:00