-2

I have a Go web app which stores some data in a built-in BoltDB.

Is there any way to read the content of it using Python?

Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150

2 Answers2

1

Create a small handler in your Go application that responds with a database dump. Check out the database backups section of the BoltDB documentation for an example.

Dmitri Goldring
  • 4,176
  • 2
  • 24
  • 28
1

Because you've already built the web app, you could just create http endpoints (or any other protocol) for each DB operation you need. Then call those endpoints from your python app.

blobdon
  • 1,176
  • 7
  • 11
  • Thanks for the response. +1 . But is there another way to read straight from BoltDB using Python? – Benyamin Jafari Dec 24 '18 at 05:56
  • 1
    I think you can compile go programs to static or shared object binary files (.a, .so) which could then be used in python, but I have no experience there. Keep in mind that only one process can use the Bolted file at once, so if your web app will be running, a second app won’t be able to connect to the db itself. You’d need to copy the db or open both in read-only mode. – blobdon Dec 24 '18 at 09:45