Coder Social home page Coder Social logo

1lann / cete Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 7.0 94 KB

An easy-to-use, lightweight embedded on-disk database built on Badger for use in your Go programs.

License: MIT License

Go 100.00%
badger database disk embedded-database go golang indexes key-value schemaless

cete's Introduction

Hello

I'm a Linux Engineer for work, but I enjoy doing all sorts of software engineering like web development, distributed systems and machine learning.

You might know me from:

You can read more about me on my personal website and my blog.

cete's People

Contributors

1lann avatar deepsourcebot avatar the-locksmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cete's Issues

warning with `table.CountBetween`

Many warnings appear, from use of this function:

cete/count_test.go

Lines 28 to 152 in 717790f

func testCounting(t *testing.T, compression bool) {
dir, err := ioutil.TempDir("", "cete_")
panicNotNil(err)
t.Log("testing directory:", dir)
defer func() {
if !t.Failed() {
os.RemoveAll(dir)
}
}()
db, err := Open(dir + "/data")
panicNotNil(err)
defer db.Close()
err = db.NewTable("count_testing", compression)
panicNotNil(err)
err = db.Table("count_testing").NewIndex("Age")
panicNotNil(err)
for i := 1; i <= 1000; i++ {
panicNotNil(db.Table("count_testing").Set(paddedItoa(i), Person{Age: i}))
}
if db.Table("count_testing").CountBetween(MinValue, "0010") != 10 {
t.Fatal("count should be 10, but isn't")
}
if db.Table("count_testing").CountBetween(MinValue, "0100") != 100 {
t.Fatal("count should be 100, but isn't")
}
if db.Table("count_testing").CountBetween("0901", MaxValue) != 100 {
t.Fatal("count should be 100, but isn't")
}
if db.Table("count_testing").CountBetween("0101", "0200") != 100 {
t.Fatal("count should be 100, but isn't")
}
if db.Table("count_testing").CountBetween("0100", "0010") != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").CountBetween(MinValue, MaxValue) != 1000 {
t.Fatal("count should be 1000, but isn't")
}
if db.Table("count_testing").CountBetween(MaxValue, MinValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").CountBetween(MinValue, MinValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").CountBetween(MaxValue, MaxValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").CountBetween("99999999", MaxValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").CountBetween(0, MaxValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").CountBetween(MinValue, 0) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(MinValue, 10) != 10 {
t.Fatal("count should be 10, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(MinValue, 100) != 100 {
t.Fatal("count should be 100, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(901, MaxValue) != 100 {
t.Fatal("count should be 100, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(101, 200) != 100 {
t.Fatal("count should be 100, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(100, 10) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(MinValue, MaxValue) != 1000 {
t.Fatal("count should be 1000, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(MaxValue, MinValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(MinValue, MinValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(MaxValue, MaxValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
if db.Table("count_testing").Index("Age").CountBetween(10000, MaxValue) != 0 {
t.Fatal("count should be 0, but isn't")
}
countError := errors.New("cete testing: count error")
r := newRange(func() (string, []byte, uint64, error) {
return "", nil, 0, countError
}, func() {}, nil)
_, err = r.Count()
if err != countError {
t.Fatal("error should be countError, but isn't")
}
}

E.g.:

=== RUN   TestCounting
2019/04/01 16:51:38 table.go:627: cete: warning: lower and upper bounds of table.CountBetween must be a string or Bounds. A count of 0 has been returned instead
2019/04/01 16:51:38 table.go:618: cete: warning: lower and upper bounds of table.CountBetween must be a string or Bounds. A count of 0 has been returned instead

A .sst file is created every time Cete is opened

第一次尝试, 发现一个问题(也可能姿势不对)

运行了那段示例的代码
上图的代码中,每次执行Open,就会多一个 .sst 文件
不太理解这是为什么

I'm using Cete for the first time, and I seem to be running into a problem (although I might be doing something incorrectly).
If you run the example code (in the README) you will find that every time Open is called, a new .sst file is created.
It isn't clear why this is so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.