2

I have an app written on golang and I want to create a builin database, I've selected boltdb. I have some init data that I want to seed into database manually. I have database.db file and I want to put some data into it.

When I open this file - I see many 'NUL' words. How can I edit .db file manually?

OneOfOne
  • 95,033
  • 20
  • 184
  • 185
Vnuuk
  • 6,177
  • 12
  • 40
  • 53

1 Answers1

0

You can't edit it manually, you have to write code code that'd do that for you.

OneOfOne
  • 95,033
  • 20
  • 184
  • 185
  • 6
    I agree that you should generally write code to manage your database state. However, if you need to inspect the database or tweak a value for some reason, Brian Buller's boltbrowser is a nice termbox UI for Bolt: https://github.com/br0xen/boltbrowser – Ben Johnson Mar 07 '16 at 20:31
  • 1
    Another one for inspect the db, check this [go install go.etcd.io/bbolt/cmd/bbolt@latest](https://developer.hashicorp.com/vault/tutorials/monitoring/inspect-data-boltdb#using-the-bbolt-cli). It will be installed in `/root/go/bin/bbolt` for root user. – Nick Dong Mar 22 '23 at 01:46