lintel 0.2.0
Loading...
Searching...
No Matches
Cursor.h
Go to the documentation of this file.
1#ifndef LINTEL_SQLITE_CURSOR_H
2#define LINTEL_SQLITE_CURSOR_H
3
4#include <sqlite3.h>
5
6#include <cstddef>
7#include <string>
8#include <vector>
9
11
12namespace lintel {
13namespace sqlite {
14 class Connection;
15
27 class Cursor
28 {
29 private:
30 sqlite3 *m_db;
31 sqlite3_stmt *m_stmt;
32 bool m_exhausted;
33 std::size_t m_fetchSize;
34
35 public:
37 static constexpr std::size_t kDefaultFetchSize = 64;
38
47 explicit Cursor(const Connection &connection,
48 const std::string &query,
49 const std::vector<std::string> &params,
50 std::size_t fetchSize = kDefaultFetchSize);
51
52 Cursor(Cursor &cursor) = delete;
53
56
65 [[nodiscard]] std::vector<db::Arguments> fetchNext(std::size_t maxRows);
66 };
67}// namespace sqlite
68
69}// namespace lintel
70#endif// LINTEL_SQLITE_CURSOR_H
Definition Connection.h:30
Definition Cursor.h:28
static constexpr std::size_t kDefaultFetchSize
Definition Cursor.h:37
Cursor(Cursor &cursor)=delete
Cursor(const Connection &connection, const std::string &query, const std::vector< std::string > &params, std::size_t fetchSize=kDefaultFetchSize)
std::vector< db::Arguments > fetchNext(std::size_t maxRows)
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9