Commit f99a63bc authored by Giorgio Azzinnaro's avatar Giorgio Azzinnaro

loader debug; conf

parent 91337232
......@@ -87,10 +87,18 @@ Loader::Loader(
// TODO This might be configured differently
if (file.path().extension() == ".proto") {
const std::string relativeProtoPath = file.path().lexically_relative(path).string();
const FileDescriptor * fileDescriptor = this->GetPool(SCHEMA).FindFileByName(relativeProtoPath);
if (fileDescriptor == nullptr) {
BOOST_LOG_TRIVIAL(error) << "File at " << relativeProtoPath << " couldn't be loaded";
throw std::runtime_error(relativeProtoPath + " couldn't be loaded");
}
// The file is now retrieved, and its path for Protobuf must be relative to the mapping
// it's parsed, normalized (nested keyable messages are removed)
FileDescriptorProto * normalizedProto = this->ParseFile(
this->GetPool(SCHEMA).FindFileByName(file.path().lexically_relative(path).string()));
FileDescriptorProto * normalizedProto = this->ParseFile(fileDescriptor);
BOOST_LOG_TRIVIAL(debug) << "Adding normalized proto " << normalizedProto->name();
BOOST_LOG_TRIVIAL(trace) << std::endl << normalizedProto->DebugString();
......
log_level=trace
proto_path=/usr/include
proto_path=/usr/local/include
[rocksdb]
path=/tmp/profanedb
syntax = "proto3";
package schema;
import "profanedb/protobuf/options.proto";
message ExternalNested {
double field_one_double = 1 [ (profanedb.protobuf.options).key = true ];
}
......@@ -4,8 +4,6 @@ package schema;
import "profanedb/protobuf/options.proto";
import "nested.proto";
// Simply check that key is serialized properly
message KeyInt {
int32 int_key = 1 [ (profanedb.protobuf.options).key = true ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment