My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Project Information
Members
Featured
Downloads
Wiki pages

tcskelbdb

Features

  • The skeleton b+tree database for Tokyo Cabinet
  • the b+tree table can support the field index for structured-value like tct(table engine).
  • specifiction:
    • MUST BE an B+ TREE Table ENGINE
    • the key and value MUST BE utf-8 format.
    • the duplication(same) key is not allowed.
    • addint, adddouble, putcat,putproc,putdup, putdupback is never indexed
    • outlist use the tcbdbout instead of tcbdbout3!
    • the setindex command is same as the tct.
      • setindex FieldName 0 //set an index to the FieldName(this do not re-create index)
      • setindex FieldName 9999 //remove the FieldName index
      • setindex FieldName 10000 //re-create the index of FieldName
    • the query command is same as the tct. (todo)
    • tcadbcopy command is not re-indexed. (todo)
    • Key Specifiction:
      • the key length should be less 2047(MAXKEYLEN) chars.
      • the start with "" is NOT ALLOWED, we keep reserve as internal used.
      • the "/", "|", "\", """, "." is not allowed too. u need escape these chars.
      • _DB/index/_conf/[FieldName]:
        • [IndexOptions]: the index options same as the tct's index options.todo
      • _DB/index/[FieldName]/[FieldValue]/[KeyName]: the index put here, store value is the field of the key.
      • the fieldValue will be quoted("") if it is a string.
        • value: [KeyName]
    • Structured-Value for Index Specifiction:
      • STRICT JSON Object only
      • The first char MUST BE "{" and the last char MUST BE "}"
      • NO MORE BLANK CHARS BE ALLOWED
      • the string MUST BE in double quote : ""
      • all the key in the json object must be a string.
      • only string, number, bool, null can be indexed.
      • the "/", "|", "\", "", """, "." char keep reserved. so the field value string MUST NOT USE these characters(u should escape these chars).
    • Structured-Value Store Specifiction:
      • Spec.1:
        • Store As Json String
        • Key: [KeyName]
        • Value: "{"[FieldName]":[FieldValue], ...}" : the json string

test :

tcrmgr vanish localhost 
tcrmgr misc localhost setindex key 0 
tcrmgr misc localhost setindex goodkey 0 
tcrmgr misc localhost setindex key1 0 
tcrmgr misc localhost setindex key2 0
tcrmgr list localhost 
tcrmgr put localhost mykey "{\"key\":\"hello\",\"goodkey\":false}"
tcrmgr put localhost mykey2 "{\"key\":\"你好\",\"goodkey\":true}"
tcrmgr list localhost 
 _DB/index/_conf/goodkey
 _DB/index/_conf/key
 _DB/index/_conf/key1
 _DB/index/_conf/key2
 _DB/index/goodkey/false/mykey
 _DB/index/goodkey/true/mykey2
 _DB/index/key/"hello"
 _DB/index/key/"你好"
 mykey
 mykey2
tcrmgr misc localhost put mykey3 "{\"key\":\"hi,every body\",\"goodkey\":null, \"opt\":0, \"key2\":\"same thing\"}"

Requirements

tcskeldb

  • The skeleton multi-tables database for Tokyo Cabinet
  • the normal database can manage the multi-talbes with multi-types.
  • One Folder means one databse.
  • Note: It is not fined yet.

Code Licese: GNU Lesser General Public License

Powered by Google Project Hosting