Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .claude/skills/sqlitecpp-build-cmake/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: sqlitecpp-build-cmake
description: Builds SQLiteCpp with CMake on Windows, Linux, or macOS. Use when configuring CMake builds, tests, options, or build scripts.
---

# SQLiteCpp CMake Build

## Quick builds
- Windows (VS 2022):
- `mkdir build`
- `cd build`
- `cmake -G "Visual Studio 17 2022" -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_BUILD_EXAMPLES=ON ..`
- `cmake --build . --config Release`
- Unix/macOS:
- `mkdir build && cd build`
- `cmake -DCMAKE_BUILD_TYPE=Debug -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_BUILD_EXAMPLES=ON ..`
- `cmake --build .`

## Build scripts
- `build.bat` (Windows) enables shared libs, tests, examples, and runs `ctest`.
- `build.sh` (Unix) enables ASAN, shared libs, tests, examples, and runs `ctest`.

## Common options
- `SQLITECPP_BUILD_TESTS` (OFF): build unit tests.
- `SQLITECPP_BUILD_EXAMPLES` (OFF): build examples.
- `BUILD_SHARED_LIBS` (OFF): build shared libs (DLLs).
- `SQLITECPP_INTERNAL_SQLITE` (ON): use bundled sqlite3 source.
- `SQLITE_ENABLE_COLUMN_METADATA` (ON): enable `getColumnOriginName()`.
- `SQLITECPP_RUN_CPPLINT` (ON): run cpplint target.
- `SQLITECPP_RUN_CPPCHECK` (ON): run cppcheck target.
- `SQLITECPP_RUN_DOXYGEN` (OFF): generate docs.
- `SQLITECPP_USE_ASAN` (OFF): address sanitizer.
- `SQLITECPP_USE_GCOV` (OFF): GCov coverage.

## Tests
- `ctest --output-on-failure`
- `ctest --output-on-failure -V`
- `ctest --output-on-failure -R "Database"`

## Notes
- Tests require the `googletest` submodule: `git submodule update --init --recursive`.
35 changes: 35 additions & 0 deletions .claude/skills/sqlitecpp-build-meson/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: sqlitecpp-build-meson
description: Builds SQLiteCpp with Meson. Use when configuring Meson builds, tests, or Meson options.
---

# SQLiteCpp Meson Build

## Quick builds
- Default build:
- `meson setup builddir`
- `meson compile -C builddir`
- With tests and examples:
- `meson setup builddir -DSQLITECPP_BUILD_TESTS=true -DSQLITECPP_BUILD_EXAMPLES=true`
- `meson compile -C builddir`
- `meson test -C builddir`

## CI-style setup (GitHub Actions)
- `meson setup builddir -DSQLITECPP_BUILD_TESTS=true -DSQLITECPP_BUILD_EXAMPLES=true --force-fallback-for=sqlite3`
- `meson compile -C builddir`
- `meson test -C builddir`

## Options
- `SQLITECPP_BUILD_TESTS`: build unit tests.
- `SQLITECPP_BUILD_EXAMPLES`: build examples.
- `SQLITE_ENABLE_COLUMN_METADATA`: enable column origin metadata.
- `SQLITE_ENABLE_ASSERT_HANDLER`: enable assert handler.
- `SQLITE_HAS_CODEC`: enable codec API (requires SQLCipher).
- `SQLITE_USE_LEGACY_STRUCT`: legacy `sqlite3_value` struct.
- `SQLITECPP_DISABLE_STD_FILESYSTEM`: disable std::filesystem.
- `SQLITECPP_DISABLE_SQLITE3_EXPANDED_SQL`: disable sqlite3_expanded_sql.
- `SQLITE_OMIT_LOAD_EXTENSION`: omit load extension.

## Notes
- Meson defaults to `cpp_std=c++17` to support newer gtest versions.
- On Windows, Meson enforces at least C++14 if needed by headers.
38 changes: 38 additions & 0 deletions .claude/skills/sqlitecpp-ci-workflows/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: sqlitecpp-ci-workflows
description: SQLiteCpp CI workflow patterns (GitHub Actions, AppVeyor, Travis). Use when updating CI configs, build matrices, or test steps.
---

# SQLiteCpp CI Workflows

## Common steps
- Checkout code.
- Initialize submodules: `git submodule update --init --recursive`.
- Configure build directory (`build` or `builddir`).
- Build and run tests with verbose output.

## GitHub Actions (CMake)
- Matrix across Windows (MSVC/MinGW), Ubuntu, macOS.
- CMake config includes:
- `-DBUILD_SHARED_LIBS=ON`
- `-DSQLITECPP_BUILD_TESTS=ON`
- `-DSQLITECPP_BUILD_EXAMPLES=ON`
- `-DSQLITECPP_RUN_CPPCHECK=OFF`
- `-DSQLITECPP_RUN_CPPLINT=OFF`
- Tests: `ctest --verbose --output-on-failure`.

## GitHub Actions (Meson)
- Use `pipx install meson ninja`.
- Set `CC`, `CXX`, and optional linkers.
- Setup: `meson setup builddir -DSQLITECPP_BUILD_TESTS=true -DSQLITECPP_BUILD_EXAMPLES=true --force-fallback-for=sqlite3`.
- Build: `meson compile -C builddir`.
- Test: `meson test -C builddir`.

## AppVeyor
- Visual Studio 2022/2015, Debug/Release, Win32/x64.
- CMake config: `-DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_CPPCHECK=OFF`.
- Build and run `ctest --output-on-failure`.

## Travis CI
- Multiple GCC/Clang versions across Linux and macOS.
- Variants for ASAN, GCov, Valgrind, shared libs, external sqlite3.
31 changes: 31 additions & 0 deletions .claude/skills/sqlitecpp-coding-standards/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: sqlitecpp-coding-standards
description: Enforces SQLiteCpp coding standards and API rules. Use when editing core library code, public headers, or reviewing style, naming, and Doxygen compliance.
---

# SQLiteCpp Coding Standards

## Non-negotiables
- RAII only: acquire in constructors, release in destructors.
- Never throw in destructors; use `SQLITECPP_ASSERT()` instead.
- C++11 only in core library (C++14 only in `VariadicBind.h` and `ExecuteMany.h`).
- Public API headers must not include `sqlite3.h`.
- Public API must use `SQLITECPP_API` from `SQLiteCppExport.h`.
- One `Database`/`Statement`/`Column` per thread.

## Error handling
- Throw `SQLite::Exception` for errors in throwing APIs.
- Use `tryExec()`, `tryExecuteStep()`, `tryReset()` for error codes.

## Documentation and style
- Doxygen required for public API (`@brief`, `@param`, `@return`, `@throw`).
- ASCII only, 4 spaces, Allman braces, max 120 chars, LF line endings, final newline.
- Use `#pragma once` in headers.

## Naming conventions
- Types: PascalCase (`Database`, `Statement`).
- Functions/vars: camelCase (`executeStep()`, `getColumn()`).
- Members: `m` prefix (`mDatabase`).
- Args: `a` prefix (`aDatabase`).
- Booleans: `b`/`mb` prefix (`bExists`, `mbDone`).
- Pointers: `p`/`mp` prefix (`pValue`, `mpSQLite`).
61 changes: 61 additions & 0 deletions .claude/skills/sqlitecpp-doxygen-guide/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: sqlitecpp-doxygen-guide
description: Doxygen documentation standards and templates for SQLiteCpp. Use when documenting public API, writing file headers, or ensuring documentation compliance.
---

# SQLiteCpp Doxygen Guide

> **For general style rules, see /AGENTS.md and sqlitecpp-coding-standards.**

## Scope
- Doxygen runs on both `include/` and `src/` (see `Doxyfile`).
- Public API must be documented in headers.
- Source files still use Doxygen file headers.

## Basic Example (Format Only)
```cpp
/**
* @file Example.h
* @ingroup SQLiteCpp
* @brief One-line summary of the file.
*/
class SQLITECPP_API Example
{
public:
/**
* @brief Do the thing.
* @param[in] aValue Value to use
* @return Result value
* @throw SQLite::Exception in case of error
*/
int doThing(int aValue);
};
```
Keep the full MIT license block in real file headers.

## Canonical Examples (Use These)
- File header + class + methods: `include/SQLiteCpp/Database.h`
- File header in `src/`: `src/Database.cpp`

## File Header Rules
- Keep `@file`, `@ingroup`, `@brief`.
- Keep the MIT license block and copyright line.
- Keep `#pragma once` in headers.
- Match the existing header of the file you edit.

## API Comment Rules
- `@brief` for every public class/method.
- `@param[in|out]` for each parameter.
- `@return` for non-void return values.
- `@throw SQLite::Exception` for throwing APIs.
- Use `@note`/`@warning` only when needed.

## Generate Docs
```bash
cmake -DSQLITECPP_RUN_DOXYGEN=ON ..
cmake --build . --target SQLiteCpp_doxygen
```
Output: `doc/html/index.html`

## Cross-References
- Workflow checklist: see `sqlitecpp-workflow`
26 changes: 26 additions & 0 deletions .claude/skills/sqlitecpp-git-branching/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: sqlitecpp-git-branching
description: SQLiteCpp branch naming and creation rules. Use when starting a task/issue/feature and creating a new git branch.
---

# SQLiteCpp Git Branching

## When to create a branch
- User mentions working on a task, issue, or feature.
- User references a GitHub issue number.

## Before starting work
1. Run `git status` to check current branch.
2. If on `master` or wrong branch, create a task-specific branch from `master`.

## Branch naming
- With issue: `<issue>-<type>-<short-description>`
- `123-fix-short-description`
- `123-feature-short-description`
- Without issue: `<type>-<short-description>`
- `fix-short-description`
- `feature-short-description`
- Issue ID is optional; do not use a `000-` prefix.

## Branch-only requests
- If the user only requests a branch, create it and stop (no file changes).
29 changes: 29 additions & 0 deletions .claude/skills/sqlitecpp-sqlite-flags/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: sqlitecpp-sqlite-flags
description: SQLiteCpp and sqlite3 feature flags. Use when enabling or disabling SQLite features in CMake or Meson builds.
---

# SQLiteCpp and SQLite Flags

## Core SQLiteCpp options (CMake)
- `SQLITECPP_INTERNAL_SQLITE` (ON): build bundled sqlite3.
- `SQLITECPP_USE_ASAN` (OFF): address sanitizer.
- `SQLITECPP_USE_GCOV` (OFF): coverage.
- `SQLITECPP_DISABLE_STD_FILESYSTEM` (OFF): disable std::filesystem.
- `SQLITECPP_DISABLE_EXPANDED_SQL` (OFF): disable sqlite3_expanded_sql.

## SQLite feature flags (CMake and Meson)
- `SQLITE_ENABLE_COLUMN_METADATA` (ON): enable `getColumnOriginName()`.
- `SQLITE_ENABLE_ASSERT_HANDLER` (OFF): enable custom assert handler.
- `SQLITE_HAS_CODEC` (OFF): enable codec API (SQLCipher).
- `SQLITE_USE_LEGACY_STRUCT` (OFF): legacy `sqlite3_value`.
- `SQLITE_OMIT_LOAD_EXTENSION` (OFF): disable load_extension.
- `SQLITE_ENABLE_RTREE` (OFF): enable RTree (internal sqlite3).
- `SQLITE_ENABLE_DBSTAT_VTAB` (OFF): enable DBSTAT (internal sqlite3).

## DLL build flags (Windows)
- `BUILD_SHARED_LIBS=ON` adds `SQLITECPP_COMPILE_DLL` and `SQLITECPP_DLL_EXPORT`.

## Usage notes
- Column metadata requires sqlite3 built with `SQLITE_ENABLE_COLUMN_METADATA`.
- External sqlite3 may not support load_extension on macOS.
60 changes: 60 additions & 0 deletions .claude/skills/sqlitecpp-testing-practices/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: sqlitecpp-testing-practices
description: GoogleTest patterns and testing best practices for SQLiteCpp. Use when writing tests, adding test coverage, or understanding test structure.
---

# SQLiteCpp Testing Practices

## Scope
- Uses GoogleTest (system if found, otherwise `googletest/` fallback).
- Test files live in `tests/*_test.cpp` (see `tests/Database_test.cpp`).
- File headers use `@ingroup tests`.

## Test File Structure
```cpp
#include <gtest/gtest.h>
#include <SQLiteCpp/Database.h>

TEST(DatabaseTest, CanOpenReadWriteDatabase)
{
// Arrange: setup test database
SQLite::Database db(":memory:", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);

// Act: perform operation
db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY)");

// Assert: verify behavior
EXPECT_EQ(1, db.exec("INSERT INTO test DEFAULT VALUES"));
}
```


## Adding a New Test File
- Create `tests/NewClass_test.cpp`.
- Register it in `CMakeLists.txt` under `SQLITECPP_TESTS`.
- Register it in `meson.build` under `sqlitecpp_test_srcs`.

## Common Patterns
- Prefer `:memory:` databases when possible.
- Use file-based databases when testing file I/O behavior (see `tests/Database_test.cpp`).
- Use `TEST()` for independent tests; use `TEST_F()` only when a shared fixture is needed.

## Running Tests
```bash
# CMake (from build dir)
ctest --output-on-failure
bin/SQLiteCpp_tests --gtest_filter=Database.*

# Meson
meson test -C builddir
meson test -C builddir --test-args="--gtest_filter=Database.*"
```

## Canonical References
- Test style: `tests/Database_test.cpp`
- CMake test list: `CMakeLists.txt` (`SQLITECPP_TESTS`)
- Meson test list: `meson.build` (`sqlitecpp_test_srcs`)

## Cross-References
- Workflow checklist: `sqlitecpp-workflow`
- Build configuration: `sqlitecpp-build-cmake`, `sqlitecpp-build-meson`
30 changes: 30 additions & 0 deletions .claude/skills/sqlitecpp-troubleshooting/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: sqlitecpp-troubleshooting
description: Diagnoses common SQLiteCpp build and runtime issues. Use when investigating compiler or linker errors and sqlite3 integration problems.
---

# SQLiteCpp Troubleshooting

## Common compiler errors
- MSVC: `error C2065` or `C2039` usually means a missing include or wrong symbol.
- GCC/Clang: `use of undeclared identifier` or `no member named` indicates missing includes or API mismatch.

## Common linker errors
- `LNK2019 unresolved external symbol "SQLite::Database::exec"`:
- Missing SQLiteCpp library or missing source file in build.

## Missing sqlite3 on Linux
- Errors like `undefined reference to sqlite3_xxx`:
- Install `libsqlite3-dev`, or enable internal sqlite3.
- CMake option: `-DSQLITECPP_INTERNAL_SQLITE=ON`.

## Column metadata error
- `undefined reference to sqlite3_column_origin_name`:
- Your sqlite3 library lacks `SQLITE_ENABLE_COLUMN_METADATA`.
- Options:
- Rebuild sqlite3 with that flag.
- Disable `SQLITE_ENABLE_COLUMN_METADATA`.
- Use internal sqlite3 (`SQLITECPP_INTERNAL_SQLITE=ON`).

## Destructors and assertions
- Do not throw in destructors; use `SQLITECPP_ASSERT()` instead.
26 changes: 26 additions & 0 deletions .claude/skills/sqlitecpp-workflow/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: sqlitecpp-workflow
description: SQLiteCpp change workflow checklists. Use when adding methods/classes, updating public API, or planning changes that require tests and build updates.
---

# SQLiteCpp Workflow

## Change checklist
- [ ] Public API has Doxygen (`@brief`, `@param`, `@return`, `@throw`).
- [ ] Tests added under `tests/`.
- [ ] Build files updated (`CMakeLists.txt`, `meson.build`).
- [ ] `CHANGELOG.md` updated for user-facing changes.

## Add a method
1. Declare in `include/SQLiteCpp/<Class>.h` with Doxygen.
2. Implement in `src/<Class>.cpp`.
3. Add tests in `tests/<Class>_test.cpp`.
4. Update `CHANGELOG.md`.

## Add a class
1. Create `include/SQLiteCpp/NewClass.h` and `src/NewClass.cpp`.
2. Add files to `CMakeLists.txt` (`SQLITECPP_SRC` and `SQLITECPP_INC`).
3. Add files to `meson.build`.
4. Include in `SQLiteCpp.h` if public API.
5. Create `tests/NewClass_test.cpp`.
6. Add test to `CMakeLists.txt` and `meson.build`.
Loading