How to design this problem?

I have set up a database in elixir using Postgres and It has some static data inside to it. Now I want to know if I can insert data through Golang Post API which I have set up in the elixir. Is it possible?

Can someone give some suggestions?

If your elixir application inserts data in the database on receiving a POST request, then it does not matter if that POST request was created with a go client, curl or a browser, as long as data is encoded correctly.

But maybe I understand your question wrong?

1 Like

So for now what i’m doing I have created a user schema, model and migration table for that. Now I don’t want to use controller in phoenix. Instead I want to create a POST API in golang and try inserting the data then. Am I making sense? Let me know

How do I make a communication between them
is what I’m asking?

I’m not familiar with Go at all, but I’m sure there’s a Postgres driver. So you can write it directly to the database. Not sure if that’s your question. There’s nothing that Elixir does that would limit your ability to replicate the schema in Go and write directly to your table. Not really sure I see the point though.

If you want to create a simple REST API in your Elixir service as a proxy to the DB, and don’t want to use Phoenix checkout https://github.com/christopheradams/plug_rest or https://hex.pm/packages/plug_cowboy