mirror of
https://github.com/getml/sqlgen.git
synced 2025-12-31 14:39:31 -06:00
Use unique cursor names in postgres (#113)
This commit is contained in:
committed by
GitHub
parent
9d0f0a29ab
commit
a558c7bb23
@@ -1,3 +1,6 @@
|
||||
#ifndef SQLGEN_INTERNAL_RANDOM_HPP
|
||||
#define SQLGEN_INTERNAL_RANDOM_HPP
|
||||
|
||||
#include <random>
|
||||
#include <string>
|
||||
|
||||
@@ -11,3 +14,6 @@ inline std::string random() {
|
||||
}
|
||||
|
||||
} // namespace sqlgen::internal
|
||||
|
||||
#endif // SQLGEN_INTERNAL_RANDOM_HPP
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "../Ref.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../internal/random.hpp"
|
||||
#include "../sqlgen_api.hpp"
|
||||
#include "PostgresV2Connection.hpp"
|
||||
#include "PostgresV2Result.hpp"
|
||||
@@ -52,8 +53,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.
|
||||
|
||||
Reference in New Issue
Block a user