Open mhdirkse opened 5 years ago
by dirkse
by dirkse
by dirkse
Client-side data can best be stored in a relational database. This make searching the data easier. But the right tool has to be chosen.
I have a working example in Golang with SQLite. There is a standard database interface "database/sql" that multiple drivers implement. I chose this driver: https://github.com/mattn/go-sqlite3.
I wondered whether to use an ORM framework, like you have Hibernate for Java. I found this discussion:
https://www.reddit.com/r/golang/comments/3ajqa6/golang_which_orm_is_better/
Mr. or Mrs. hobbified found no framework that satisfied him or her. I tend to believe him, because I also found for web development that web framework are no improvement to pure Golang.
Hobbified, and other users, recommend https://github.com/jmoiron/sqlx, which provides some extras to database/sql. It allows more compact syntax to fetch multi-row results and read and write structs. Boilerplate code still is not eliminated.
I think the following is best for Alexandria. I can write a separate module, or Data Access Objects (DAOs) to access a local database. I can generate DAO code to be more efficient.
Here is a manual about database/sql:
[AX-21] created by mdi