MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getSchemaCypher

Function getSchemaCypher

src/processor/operator/simple/export_db.cpp:130–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130std::string getSchemaCypher(ClientContext* clientContext) {
131 stringstream ss;
132 exportLoadedExtensions(ss, clientContext);
133 const auto catalog = Catalog::Get(*clientContext);
134 auto transaction = Transaction::Get(*clientContext);
135 ToCypherInfo toCypherInfo;
136 for (const auto& nodeTableEntry :
137 catalog->getNodeTableEntries(transaction, false /* useInternal */)) {
138 ss << nodeTableEntry->toCypher(toCypherInfo) << std::endl;
139 }
140 RelGroupToCypherInfo relTableToCypherInfo{clientContext};
141 for (const auto& entry : catalog->getRelGroupEntries(transaction, false /* useInternal */)) {
142 ss << entry->toCypher(relTableToCypherInfo) << std::endl;
143 }
144 RelGroupToCypherInfo relGroupToCypherInfo{clientContext};
145 for (const auto sequenceEntry : catalog->getSequenceEntries(transaction)) {
146 ss << sequenceEntry->toCypher(relGroupToCypherInfo) << std::endl;
147 }
148 for (auto macroName : catalog->getMacroNames(transaction)) {
149 ss << catalog->getScalarMacroFunction(transaction, macroName)->toCypher(macroName)
150 << std::endl;
151 }
152 return ss.str();
153}
154
155std::string getCopyCypher(const ClientContext* context, const FileScanInfo* boundFileInfo,
156 const std::unordered_map<std::string, const std::atomic<bool>*>& canUseParallelReader) {

Callers 1

executeInternalMethod · 0.85

Calls 7

exportLoadedExtensionsFunction · 0.85
getNodeTableEntriesMethod · 0.80
getRelGroupEntriesMethod · 0.80
getSequenceEntriesMethod · 0.80
getMacroNamesMethod · 0.80
toCypherMethod · 0.45

Tested by

no test coverage detected