\brief Return a metadata item. * * Value remains valid while this is alive and to the next call to getMetadata */
| 2783 | * Value remains valid while this is alive and to the next call to getMetadata |
| 2784 | */ |
| 2785 | const char *DatabaseContext::getMetadata(const char *key) const { |
| 2786 | auto res = |
| 2787 | d->run("SELECT value FROM metadata WHERE key = ?", {std::string(key)}); |
| 2788 | if (res.empty()) { |
| 2789 | return nullptr; |
| 2790 | } |
| 2791 | d->lastMetadataValue_ = res.front()[0]; |
| 2792 | return d->lastMetadataValue_.c_str(); |
| 2793 | } |
| 2794 | |
| 2795 | // --------------------------------------------------------------------------- |
| 2796 |
no test coverage detected