libpqxx:test-span-conversion

Last commit made on 2024-02-10
Get this branch:
git clone -b test-span-conversion https://git.launchpad.net/libpqxx

Branch merges

Branch information

Name:
test-span-conversion
Repository:
lp:libpqxx

Recent commits

4e29ae4... by Jeroen T. Vermeulen

Test conversion from `span` to SQL array.

16defbd... by Jeroen T. Vermeulen

NEWS.

5e22e58... by IvanD <email address hidden>

Native support for std::span (#776)

1445b97... by Jeroen Vermeulen <email address hidden>

Drop more unused `char_traits<std::byte` functions. (#794)

Like `length()`, these functions make no sense for binary data. So
we're better off risking a link error by leaving them undefined, than
defining them and risking them actually gettnig used.

376124a... by Jeroen Vermeulen <email address hidden>

Fix lint check, fix many clang-tidy warnings. (#759)

* Fix problems with lint script.
* Extend static analysis checks.
* Fix loads of lint.

Also, it turns out `sql_cursor` doesn't need `m_adopted`!

The only time this class needs to know the difference is during
construction. Feels good to drop a data member. _Kudos_ to
`clang-tidy` for spotting this.

a5e52dd... by Jeroen Vermeulen <email address hidden>

Some minor tweaks for `char_traits` work. (#792)

* Some minor tweaks for `char_traits` work.

Patches up some very minor details after merging @tambry's great contribution in #751.

After this I'll run the automatic formatter as well.

* Don't define char traits' `length()`.

This function is just not appropriate to a `std::byte` specialisation.
There is no way inspect the contents of a raw byte string and figure
out from there what the string's length is.

So, remove the function's definition. The _declaration_ is required,
but there can't be a usable definition.

e765554... by Jeroen Vermeulen <email address hidden>

Fixes for the documentation build. (#793)

* Set `language`.

* Add `doc/_static/` directory.

90f9c7c... by Raul Tambre <email address hidden>

pqxx::byte and pqxx::bytes_view to support lack of std::char_traits<byte> (#751)

The standard doesn't specify a generic implementation of std::char_traits, only specializations for certain types.
For a good reason: it's unlikely to be correct for all types that it'll compile with it.

All standard libraries today however do provide a generic implementation as an extension, though it's bound to be incorrect for some types.
libc++ has deprecated its in version 18 and will remove it in version 19 to eliminate hard to find correctness issues stemming from this.

Replace with type aliases that will use a custom char_traits when the standard library lacks such a generic implementation.
Note that we don't unconditionally use the custom char_traits variant as it's a source-breaking change requiring the users to update all usages of `std::string<std::byte>` to `pqxx::bytes` (i.e. `std::string<std::byte, pqxx::byte_char_traits>`). Ditto `std::string_view<std::byte>` and `pqxx::bytes_view`.
But for implementations lacking a generic implementation `std::string<std::byte>` and `std::string_view<std::byte>` wouldn't compile anyway so it's fine.

The aliases are named as `bytes` and `bytes_view` with the intetion of switching them to `std::vector<std::byte>` and `std::span<std::byte>` in a future major release that requires C++20.

Fixes: #726

By Raul Tambre <email address hidden>

6120486... by Jeroen Vermeulen <email address hidden>

Just always `pip install ruff pyflakes3`. (#788)

In the lint script, the logic for calling ruff and/or pyflakes or pyflakes3 got too tedious. Just pip install them every time and we know what to count on.

And since we'll then always have the virtualenv, this also installs clang-tidy in there, rather than looking for it installed with the OS.

afaab9b... by Jeroen Vermeulen <email address hidden>

Update copyright notices to 2024. (#787)