| 1902 | } |
| 1903 | |
| 1904 | Status Server::FunctionGetCode(const std::string &lib, std::string *code) const { |
| 1905 | std::string func_name = engine::kLuaLibCodePrefix + lib; |
| 1906 | auto cf = storage->GetCFHandle(ColumnFamilyID::Propagate); |
| 1907 | engine::Context ctx(storage); |
| 1908 | auto s = storage->Get(ctx, ctx.GetReadOptions(), cf, func_name, code); |
| 1909 | if (!s.ok()) { |
| 1910 | return {s.IsNotFound() ? Status::NotFound : Status::NotOK, s.ToString()}; |
| 1911 | } |
| 1912 | return Status::OK(); |
| 1913 | } |
| 1914 | |
| 1915 | Status Server::FunctionGetLib(const std::string &func, std::string *lib) const { |
| 1916 | std::string func_name = engine::kLuaFuncLibPrefix + func; |
no test coverage detected