In addition to the links that Bryce provided, the arrow Go library *does* support marshalling a record batch into JSON if that's desired. You should be able to simply pass a record batch to the json.Marshal functions.
That said, the ipc route that Bryce linked would be much more efficient. On Thu, Mar 28, 2024, 12:21 PM Bryce Mecum <bryceme...@gmail.com> wrote: > Hi Tom, > > The short answer is that you want to send your table as Arrow IPC and > let the libraries do most of the work serializing and deserializing. > That said, what this looks like in a real world scenario like yours > isn't currently well-documented but that is rapidly changing. Ian Cook > has been working with the community to build examples and there are > now examples for Go on the server [1] and JavaScript on the client [2] > you might want to look at. > > [1] > https://github.com/apache/arrow-experiments/blob/main/http/get_simple/go/server/server.go > [2] > https://github.com/apache/arrow-experiments/blob/main/http/get_simple/js/client/client.js > > On Wed, Mar 27, 2024 at 6:43 AM Tom Houghton <tomhoughto...@gmail.com> > wrote: > > > > Hi, > > > > I’ve created an API and backend in Golang that accesses our database, > and I’ve built a frontend in NextJS with Typescript. > > I would like to send data from my backend to my frontend in the form of > API requests, using Apache Arrow’s standardised format. > > > > The trouble I’m having is that I can’t find any way to send this data. > > > > I’ve tried creating a record batch and turning it into a byte-array > (which seems to be the recommended method for Go), but from what I can see > the Javascript package on frontend only supports converting JSON to a > table? And from what I can tell, Go doesn’t support serialising table into > JSON at all? > > > > I’m certain that I’m missing something big here, but could someone point > me in the direction of the documentation I should read to figure this out, > or tell me what format is best for transferring data between a frontend and > backend? > > > > Thanks, > > Tom. >