-
Notifications
You must be signed in to change notification settings - Fork 235
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
Array types with other containers #769
Comments
Actually, that looks like it should just be in libpqxx as standard! (At least, for C++20 or better.) Here's the solution I would propose:
Does that look good? One painful note: |
The actual work was done by my coworker and I wouldn't want to misappropriate it. I will ask him if he's willing to do the PR. |
@alexolog It's merged. Sorry it took so long. In theory that takes care of the blockers for a 7.9.0 release. Now we give it a little bit of time for people to report problems with the latest changes; deal with those; and... release. |
@alexolog, @fallenworld1 — I've released 7.9.0 with your work in it. Will close this ticket soon. If you try it and find a problem, by all means file a new ticket! |
Why not allow the operation with the caveat that either the encoding will have to be explicitly specified by the user or no encoding conversion will be performed? I opened #841 for it |
@alexolog we'll continue conversation in #841 then. But note that no encoding conversion is involved here. It's just that libpqxx needs to be aware in various situations of where the next character begins. Without that, for example, it might stumble when it sees a byte that happens to be the same numeric value as an ASCII quote or backslash, but is actually just a byte inside a multi-byte character value. It's a painful problem with real security implications. |
We are trying use a Postgres array with an
std::span
, by modelling it on the following code in include/pqxx/internal/conversions.hxx:Unfortunately, since
array_string_traits
is in theinternal
namespace, we ended up doing something like this:Which makes our code dependent on internal implementation.
Is there another, recommended way of doing it?
If not, please consider moving the template out of the
internal
namespace.The text was updated successfully, but these errors were encountered: