ahmedalhulaibi / graphqlator

https://ahmedalhulaibi.github.io/graphqlator-website/
MIT License
25 stars 0 forks source link

Ql pure golang db #13

Open ghost opened 6 years ago

ghost commented 6 years ago

Would be a nice addition.

https://github.com/cznic/ql

I saw gorm being used with it so it should work.

ahmedalhulaibi commented 6 years ago

This will have to be added as a data provider in the substance package. Just after taking a quick look I see that ql does have an implementation of a catalog/schema.

ahmedalhulaibi commented 6 years ago

Do you have an example of ql being used with gorm? I can't seem to find any

ghost commented 6 years ago

github.com/cznic/ql has some issues with ORM's like Gorm because of the lack of some functionality in ql. This is what i read at a Gorm Fork: https://github.com/ngorm/ngorm

I did find this: https://github.com/xo/usql/blob/master/drivers/ql/ql.go

Best i could do in the 10 minutes i spent on it.

ahmedalhulaibi commented 6 years ago

Awesome thanks for the links.

Ql db schema is available as go structs which is great for writing the provider. Should be more straightforward.

I have to try ngorm though to see how the generated code should work.

Just FYI this isn't going to be my number 1 priority. The main reason being that this will take more time for me to experiment. I'm trying to focus on just getting the CRUD generated properly with PostgreSQL and MySQL using gorm.

If you'd like to contribute the feature I am 100% open to that. The codebase is not perfect, but I am willing to support you through it and take any suggestions/recommendations. Just let me know if you're interested in contributing it.

ghost commented 6 years ago

I would love to contribute but have no time. I just wanted to let you know its possible. A pure golang sql db does not exist, and its huge because you can deplyoy it anyway. The only options for a sql embedded engine now are sqllite which has its own issues. Of course KV stores are also an option. Bolt and Badger are the main ones, but those require hand coding of the CRUD and joins, etc.

Anyway, just wanted to make sure you knew about QL being a viable option.