prisma / tiberius

TDS 7.2+ (Microsoft SQL Server) driver for Rust
Apache License 2.0
311 stars 113 forks source link

Allow iterating over the cells in a row #303

Closed bittrance closed 11 months ago

bittrance commented 1 year ago

It is currently possible to iterate over Row objects, but only through .into_iter() which means the borrow checker will not also let us look at the columns. Thus, it is hard to write generic code that operates on any Row object.

This PR exposes a .cells() method which allows immutable iteration over the Row object. It also exposes a public constructor for Row objects so that we can write tests for such generic code.

This addresses the iteration half of prisma/tiberius#278.