Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gorm v2-based backend #46

Closed

Conversation

stevefan1999-personal
Copy link

@stevefan1999-personal stevefan1999-personal commented Jul 14, 2020

Now, as I mentioned in #45, I'm not quite happy about this project using the so called "generic" backend with handcrafted SQL that is not actually generic across all platforms.

To truly alleviate yourself from all the craps differences on the database system we need to use ORM, and Gorm is the best out in the wild.

This also means we can delete ~300 lines of useless trash code and so there are less mental burdens and to focus more on implementing the rest of the features. I'm really hoping to see that in the future we can add more backends so that we can use Redis or Mongo which is promised by Gorm, that I used a new public beta version of Gorm😁.

btw Gorm has a compatibility interface to sql.Sql and transition from raw SQL to ORM should also be smoothy.

I've also added MSSQL support so that #43 can also be closed if this is merged for superseding.

But again, as I used the beta version of the new Gorm, so until V2 is GA this should not be merged. I use that for future proofing reason.

Problems:

  1. How do I test the dialect interface using etcdctl txn -i?
  2. The binary after go build is now C H O N K Y. Here on Windows it jumped from 6.7MB to 40MB. I just miscalculated it, I was doing a stripped build before, now with debug information it is from 32MB to 40MB now, but I think this is still large...
  3. There's no dynamic library support on Golang to add external plugins. This means importing your own DB provider on your demand is not possible (e.g. in the future there might be Oracle backend for Gorm but kine has not hardcoded to use that)
  4. Should the table be named back to kine instead of auto generated plural name? (currently the entity table name is kine_entries)

@stevefan1999-personal stevefan1999-personal marked this pull request as ready for review August 29, 2020 08:47
@stevefan1999-personal
Copy link
Author

stevefan1999-personal commented Aug 29, 2020

Gorm V2 has been released, so I think it is good to go now. This PR is open for merging.

But I had also fallen into thinking, that this is in a state of existential crisis. As k3s recently accepted to embed etcd in the next release, so this means kine would probably be abandoned due to etcd having a bigger and better scope of usage and support from community. So what I did could all go in vain.

@unixfox
Copy link

unixfox commented Dec 23, 2020

I'm interested into this PR because I want to use kine with an Oracle database.

@yue9944882
Copy link
Contributor

@stevefan1999-personal any plan to revive this thread?

@stevefan1999-personal
Copy link
Author

@yue9944882 Sure but I moved on and use their etcd backend instead, which i guess is better than using a shabby etcd wrapper that only covers the transaction extension

@dereknola dereknola closed this Nov 6, 2023
@dereknola
Copy link
Member

Closing PR as abandoned. Feel free to reopen if development continues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants