
DBGo: a light-weight relational database engine in Go - fogus
https://github.com/HouzuoGuo/DBGo
======
danieldk
From the README:

 _"DBGo" is a light-weight relational database engine implemented in Go
programming language. It is a programming exercise I gave to myself when I
began to learn Go._

That's one epic programming exercise ;). Did anyone try how it performs,
compared to SQLite?

~~~
pflanze
I don't see any code for indexing, which should answer the performance
question.

Which I don't mean to be derogative, he mentions "A flat-file relational
database engine implementation" in every file, and it looks like it may be
neat code to learn from when you're interested in Go.

~~~
BarkMore
I took a quick look at the code and noticed that error handling is not
idiomatic Go. This might not be the best place to start if you want to learn
Go.

~~~
dextorious
How is this, say, not idiomatic Go?

fi, err := directory.Readdir(0) if err != nil { db = nil logg.Err("database",
"Open", err.String()) return db, st.CannotReadDatabaseDirectory }

~~~
BarkMore
The package uses integer to represents errors instead of os.Error.

This fragment of code is not idiomatic because st.CannotReadDatabaseDirectory
is not an os.Error.

~~~
dextorious
I see -I missed that part.

I think even os.Error is not idiomatic anymore, they move Error outside the os
package to a type of it's own in a later version.

~~~
BarkMore
The pre-declared type _error_ replaces _os.Error_ in the next release of Go.

