Skip to content

get_last_insert_id(): change parameter type long long & to std::int64_t & #1232

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

Open
Spixmaster opened this issue Apr 13, 2025 · 1 comment

Comments

@Spixmaster
Copy link
Contributor

Spixmaster commented Apr 13, 2025

The function bool get_last_insert_id(std::string const &sequence, long long &value) has the unpleasant argument type long long &. This disallows passing even std::int64_t & because it equals to long &.

I prefer fixed width integers whose usage is not possible here.

https://releases.llvm.org/11.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/google-runtime-int.html also disencourages the usage of long long.

@Spixmaster Spixmaster changed the title get_last_insert_id(): change parameter type long long to std::int64_t get_last_insert_id(): change parameter type long long to std::int64_t Apr 13, 2025
@Spixmaster Spixmaster changed the title get_last_insert_id(): change parameter type long long to std::int64_t get_last_insert_id(): change parameter type long long & to std::int64_t & Apr 13, 2025
@vadz
Copy link
Member

vadz commented Apr 13, 2025

Changing it would break compatibility, which is not something we should do without good reason, but we could add an overload taking int64_t if it's a different type from long long (it might not be).

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

No branches or pull requests

2 participants