tink3rlabs / todo-service

2 stars 0 forks source link

Add SQL storage adapter postgres implementation #2

Closed deanefrati closed 4 months ago

Lutherwaves commented 4 months ago

Check out https://github.com/tink3rlabs/example-app/blob/main/internal/storage/sql.go

Lutherwaves commented 4 months ago

Gorm also has auto-migrate, which is why I picked it https://github.com/tink3rlabs/example-app/blob/main/internal/storage/client.go#L70

deanefrati commented 4 months ago

Yes i saw gorm's auto-migrate but i would like to have the ability to do migrations for other adaptors as well so am not sure that using it would be cross platform enough.

Lutherwaves commented 4 months ago

Which platforms do we aim to support? I think having an sql and no-sql adapter is close enough, we can't support everything.

I do plan on using MongoDB for example. Do we implement a mongodb adapter or a nosql adapter? Right now we have an sql adapter, but postgres is the focus, is it not a postgresadapter?

deanefrati commented 4 months ago

You're right I aim to support Postgres and Mysql in the SQL adapter but didn't implement the MySQL yet. I'll rename this to Postgres adapter and create a new issue for MySQL.

Generally speaking i agree we can't support everything so my plan for now is to support:

Added #16 for mysql

Lutherwaves commented 4 months ago

As long as we are set up for scale (sql vs no-sql) we should be good. I've done some research and would probably contribute with a mongodb adapter - any concerns?

The reason for MongoDB and not cassandra is primarily tactical, it is just super simple to setup mongodb

deanefrati commented 4 months ago

Definitely no concerns mongo is a popular option and would be good to have