mirror of
https://github.com/getml/sqlgen.git
synced 2026-05-04 06:00:44 -05:00
Refactor iterators to make sure we can use them for DuckDB (#60)
This commit is contained in:
committed by
GitHub
parent
4e98b9c0aa
commit
3769f50501
+1
-1
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user