From efcea3a80da7c4479d5fe168435ecc9fd06bdc72 Mon Sep 17 00:00:00 2001
From: John Turner <jturner.usa@gmail.com>
Date: Sun, 14 Sep 2025 00:16:10 -0400
Subject: Squashed 'subprojects/boost-sqlite/' content from commit 3378e35

git-subtree-dir: subprojects/boost-sqlite
git-subtree-split: 3378e353705271e569cf4ba15c467b840a39798c
---
 doc/reference/resultset.adoc | 72 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 doc/reference/resultset.adoc

(limited to 'doc/reference/resultset.adoc')

diff --git a/doc/reference/resultset.adoc b/doc/reference/resultset.adoc
new file mode 100644
index 0000000..fb793a5
--- /dev/null
+++ b/doc/reference/resultset.adoc
@@ -0,0 +1,72 @@
+== `sqlite/resultset.hpp`
+
+A resultset represents the results of a query.
+
+[source,cpp]
+----
+// Representation of a result from a query.
+
+struct resultset
+{
+    // Returns the current row. The row is a pure view type.
+    row current() const &;
+    // Checks if the last row has been reached.
+    bool done() const;
+
+    // Read the next row. Returns false if there's nothing more to read.
+    // Calling this will change the data of any `row` previously obtained from `current.
+    bool read_next(system::error_code & ec, error_info & ei);
+    bool read_next();
+
+    // The number of colums in the resultset
+    std::size_t column_count() const;
+    // Returns the name of the column idx.
+    string_view column_name(std::size_t idx) const;
+    // Returns the name of the source table for column idx.
+    string_view table_name(std::size_t idx) const;
+    // Returns the origin name of the column for column idx.
+    string_view column_origin_name(std::size_t idx) const;
+
+    // The input iterator can be used to read every row in a for-loop
+    struct iterator
+    {
+      using value_type = value;
+      using difference_type   = int;
+      using reference         = value&;
+      using iterator_category = std::forward_iterator_tag;
+
+      iterator() {}
+
+      bool operator!=(iterator rhs) const;
+      row &operator*();
+      row *operator->();
+
+      iterator operator++();
+      iterator operator++(int);
+    };
+
+    // Return an input iterator to the currently unread row
+    iterator begin();
+    // Sentinel iterator.
+    iterator   end();
+};
+----
+
+
+
+
+.Example
+[source,cpp]
+----
+extern sqlite::connection conn;
+
+sqlite::resultset rs = conn.query("select * from users;");
+
+do
+{
+  handle_row(r.current());
+}
+while (rs.read_next()); // read it line by line
+----
+
+
-- 
cgit v1.2.3

