Link to Database - Lyukx/SDExplorer GitHub Wiki

SDExplorer can work with database. Theoretical it can connect to any type of database if the data can be fetched and transformed to javascript style.

We prepare a template, with SDExplorer connecting to mongodb.

While using mongodb, put 3 kinds of data, message, object and group as input.

// Object format
{
  "id": <object_id>,
  "type": <object_type>,
  "name": <object_name>
}
// Group format
{
  "objs": [<object_id>, <object_id>, <object_id>, ...]
  "id": <group_id>
}
// Message format
{
  "from": <object_id>,
  "to": <object_id>,
  "message": <message_contents>,
  "id": <message_id>,
  //optional
  "count": <count>
}
// Loop format
{
  represent: [<message_id1>, <message_id2>, ...]
  field: [<message_id1>, <message_id2>, ...]
  repeat: <repeat_times>
}

The count attribute is optional, it is used in the template to fastly locate a message's location while search a message. There are several limitations while input them:

  • In SDExplorer, groups are regarded as special objects, so a group cannot have same id with any object. We suggest define group id after objects id. e.g. If there are 5 objects and 2 groups, then define object ids with 0 - 4, group ids with 5 - 6.
  • All messages have to be returned as SDExplorer shows the call-stack structure. A return message is needed for all messages. Return message has such a format:
// Return message of <message_id> has the attribute "return: true"
{
  id: <message_id>,
  from: <message_from>,
  return: true
}
⚠️ **GitHub.com Fallback** ⚠️