Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIG-1779 Let mongocxx::database be a value in the generated PhaseConfig #254

Merged
merged 2 commits into from Jun 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/create-new-actor.sh
Expand Up @@ -280,6 +280,8 @@ namespace genny::actor {
//

struct ${actor_name}::PhaseConfig {
mongocxx::database database;

mongocxx::collection collection;

//
Expand Down Expand Up @@ -316,8 +318,9 @@ struct ${actor_name}::PhaseConfig {
// documentation in ${q}context.hpp${q}.
//

PhaseConfig(PhaseContext& phaseContext, const mongocxx::database& db, ActorId id)
: collection{db[phaseContext["Collection"].to<std::string>()]},
PhaseConfig(PhaseContext& phaseContext, mongocxx::database db, ActorId id)
: database{std::move(db)},
collection{database[phaseContext["Collection"].to<std::string>()]},
documentExpr{phaseContext["Document"].to<DocumentGenerator>(phaseContext, id)} {}
};

Expand Down