kossiitkgp / KWoC-Backend

Backend API for Kharagpur Winter of Code
https://api.kwoc.kossiitkgp.org
GNU General Public License v3.0
23 stars 21 forks source link

Use Postgres in Development #180

Closed harshkhandeparkar closed 10 months ago

harshkhandeparkar commented 10 months ago

Replace the sqlite3 development database with Postgres to better represent the production environment.

shikharish commented 10 months ago

Pls assign me this.

shikharish commented 10 months ago

I belive these env variables would also have to be included if postgres is used. And README has to be updated as well.

DATABASE_HOST=
DATABASE_PORT=
DATABASE_NAME=
DATABASE_USERNAME=
DATABASE_PORT=
harshkhandeparkar commented 10 months ago

@shikharish assigned. What is your plan here?

shikharish commented 10 months ago

@harshkhandeparkar Turns out it won't be as trivial as I thought it would be. The solution I can see right now is using a postgres docker container.

harshkhandeparkar commented 10 months ago

@harshkhandeparkar Turns out it won't be as trivial as I thought it would be. The solution I can see right now is using a postgres docker container.

Hmm. Is there no way to run a postgres db from a file?

shikharish commented 10 months ago

We can but I think it would be more difficult to configure(like username, password, port etc. which would be easier in case of a container).

shikharish commented 10 months ago

We can but I think it would be more difficult to configure(like username, password, port etc. which would be easier in case of a container).

We can import an SQL file into a postgres database, not directly run the file.

harshkhandeparkar commented 10 months ago

We can but I think it would be more difficult to configure(like username, password, port etc. which would be easier in case of a container).

So the best way is to set up the container separately?

shikharish commented 10 months ago

Yes.

harshkhandeparkar commented 10 months ago

How would we do this for the CI tests?

shikharish commented 10 months ago

How would we do this for the CI tests?

Haven't looked into the tests. Where can I find them? (Should we continue this on Discord?)