database/select-database

Description

  • select database

Request URL

  • http://127.0.0.1:8888/api/

Request Method

  • POST

Parameters

Parameter NameRequiredParameter TypeDescription
typeYesintAPI ID
dbNameNostringName of the database, with lower priority than dbHandle
dbHandleNointDatabase handle, with higher priority than dbName
sqlYesstringsql

Request Example

 {
  "type": 10058,
  "dbName": "MicroMsg.db",
  "sql": "select * from sqlite_master where type=\"table\";"
 } 

Return Example

  {
    "data": {
      "status": 0,
      "desc": "",
      "data": []
    }
  }

常用查询

Get Contacts,MicroMsg.db

select *
from Contact
where (Type&0xff=3 or Type&0xff=1)
  and VerifyFlag = 0
  and UserName NOT IN ('medianote', 'fmessage', 'floatbottle');

Get Contacts acator ,MicroMsg.db

select smallHeadImgUrl
from ContactHeadImgUrl
where usrName = "filehelper";

Get Group Chats ,MicroMsg.db

select *
from Contact
where Type = 2;

Search Group Messages ,MicroMsg.db

SELECT a.UserName, a.NickName, b.smallHeadImgUrl, c.RoomData, c.Reserved2
FROM Contact a
         INNER JOIN ContactHeadImgUrl b ON a.UserName = b.usrName
         INNER JOIN ChatRoom c ON c.ChatRoomName = a.UserName
WHERE a.nickName like "%WeChatAPI%"
  AND a.Type = 2;
)

Return Parameter Description

Parameter NameParameter TypeDescription
error_codeintError code
descriptionstringError Description
datajsonBusiness data

Remark