teamnsrg / ethereum-p2p

Official Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
17 stars 9 forks source link

log neighbors to database #13

Closed SimonSK closed 6 years ago

SimonSK commented 6 years ago
zzma commented 6 years ago

@SimonSK - did you consider using an Object Relational Mapping framework such as SQLAlchemy? It will require a little bit of initial config, but ultimately should make it simpler to deal with database interactions aka you wouldn't have to write raw SQL.

SQLAlchemy also provides db connection pool management.

SimonSK commented 6 years ago

@zzma A quick search shows different opinions about ORM on go, but yea, I will look into it and change to that if codes become simpler.

As for the db connection pool, I believe the go builtin database/sql provides it as well.

zzma commented 6 years ago

Gotcha - sorry I brain farted and thought we were using python. I'm not saying that we should definitely use an ORM, but just wanted to make you aware and see if it you think it would be helpful

SimonSK commented 6 years ago

@zzma fyi, there are some changes made to the log message formats and the db table schemes in later commit that will be part of another PR. I will post that PR after this one is merged.

zzma commented 6 years ago

@SimonSK what's the status of this PR? There are still some unaddressed comments