add: gson

This commit is contained in:
huangsimin 2020-03-06 12:02:22 +08:00
parent 779d60a533
commit bb115da3e6

View File

@ -29,11 +29,13 @@ func init() {
}
func NewEasyDataBase() *EasyDataBase {
edb := &EasyDataBase{}
db, cfs := OpenDataBase()
edb.DB = db
edb.CFS = cfs
return edb
}
type EasyDataBase struct {
@ -51,9 +53,11 @@ type Metadata struct {
}
type Field struct {
Name string
Type int
Key string
ValueType int
ID int
IsIndex bool
IsUnique bool
}
@ -82,7 +86,8 @@ func CreateTable(name string, field []*Field) {
}
// {tableid(2)}{fieldid(2)}{value}{indexid(8)} = {rowid(8)} {rowid} = {values}
// gson
// OpenDataBase (cf-key.{tableid(2)}{fieldid(2)}) {value}{indexid(6)} = {rowid(6)} (cf-row.{tableid(2)} {row-sharding-id}){rowid(6)} = {values}
func OpenDataBase() (*gorocksdb.DB, []*gorocksdb.ColumnFamilyHandle) {
bbto := gorocksdb.NewDefaultBlockBasedTableOptions()