Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/sqlgen/internal/random.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef SQLGEN_INTERNAL_RANDOM_HPP
#define SQLGEN_INTERNAL_RANDOM_HPP

#include <random>
#include <string>

Expand All @@ -11,3 +14,6 @@ inline std::string random() {
}

} // namespace sqlgen::internal

#endif // SQLGEN_INTERNAL_RANDOM_HPP

4 changes: 2 additions & 2 deletions include/sqlgen/postgres/Iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "../Ref.hpp"
#include "../Result.hpp"
#include "../internal/random.hpp"
#include "../sqlgen_api.hpp"
#include "PostgresV2Connection.hpp"
#include "PostgresV2Result.hpp"
Expand Down Expand Up @@ -43,8 +44,7 @@ class SQLGEN_API Iterator {

private:
static std::string make_cursor_name() {
// TODO: Create unique cursor names.
return "sqlgen_cursor";
return "sqlgen_cursor_" + internal::random();
}

/// Shuts the iterator down.
Expand Down
Loading