-
-
Notifications
You must be signed in to change notification settings - Fork 269
Open
Description
Just to be clear this question relates to a hobby project
I have this class
#pragma once
#include "baseclass.h"
#include "stringhelper.h"
#include "wordlelevelhelper.h"
#include <string>
#include <cpprest/http_client.h>
class WordleAnswer
{
public:
WordleAnswer();
std::string ToString() ;
std::string GetJSON() ;
int id;
std::string Answer;
std::string WordleDate;
std::string StarterWord;
std::string Notes;
int Attempts;
bool Solved;
std::vector<std::string> Attemptslist;
Wordlelevel WordleLevel;
};No prizes for guessing my project, with the help of @jtv and others on here I've written string_traits to handle sending and retrieving this struct from pg, before I pull what is left of my hair out I thought I'd ask you knowledgeable lot if it's doable to return a pg setof wordleanswer into a std::vector at the moment I can retrieve a single with code as below where r is a pqxx::result
WordleAnswer wa = r[0][0].as<WordleAnswer>(); And I would like to be able to do
std::vector<WordleAnswer> was = r[0][0].as<std::vector<WordleAnswer>>();
Any help much appreciatedMetadata
Metadata
Assignees
Labels
No labels