graphqlator icon indicating copy to clipboard operation
graphqlator copied to clipboard

Ql pure golang db

Open ghost opened this issue 6 years ago • 5 comments

Would be a nice addition.

https://github.com/cznic/ql

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

ghost avatar Apr 25 '18 09:04 ghost

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 avatar Apr 25 '18 14:04 ahmedalhulaibi

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

ahmedalhulaibi avatar Apr 25 '18 18:04 ahmedalhulaibi

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.

ghost avatar Apr 26 '18 15:04 ghost

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.

ahmedalhulaibi avatar Apr 27 '18 06:04 ahmedalhulaibi

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.

ghost avatar Apr 27 '18 11:04 ghost