Skip to content

Conversation

@bstarynk
Copy link

We add the ability to force the end of a prepared statement with endr and the ability to give functions to them.

@zauguin
Copy link
Collaborator

zauguin commented Apr 28, 2017

@bstarynk Have you seen the ++ operator?
Your ppsi << "zero" << 0 << endr; can be written today as (ppsi << "zero" << 0)++;


}

auto ppsc = db << "CREATE TABLE tnums(name VARCHAR(30) PRIMARY KEY ASC NOT NULL UNIQUE, num INT NOT NULL);";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement is never executed. Either don't save the prepared statement to execute it implicitly or call execute/endr/operator++.

execute();
reset();
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have the operator, so I don't think we need a member function. If we keep this function, we may prefer a more descriptive name.

f(db);
return db;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use our function_traits instead of std::function here to avoid type-erasure?
What is the use-case for calling this with a lambda?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants