Refactor iterators to make sure we can use them for DuckDB (#60)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2025-10-07 23:51:15 +02:00
committed by GitHub
parent 4e98b9c0aa
commit 3769f50501
31 changed files with 180 additions and 117 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ for (const sqlgen::Result<Person>& person : people_range) {
}
```
`sqlgen::Range<T>` satisfies the `std::ranges::input_range` concept, making it compatible with C++20 ranges and views. This allows for memory-efficient iteration through database results and enables composition with other range operations:
`people_range` satisfies the `std::ranges::input_range` concept, making it compatible with C++20 ranges and views. This allows for memory-efficient iteration through database results and enables composition with other range operations:
```cpp
using namespace std::ranges::views;
+1 -1
View File
@@ -172,7 +172,7 @@ const auto people_vec = query | to<std::vector<Person>>;
const auto person = query | to<Person>;
// Return as Range (lazy evaluation)
const auto people_range = query; // Returns Range<Person> by default
const auto people_range = query; // Returns Range<...> by default
```
### Automatic Type Deduction