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
Native Go SQLite implementation #150
Comments
@tangyang9464 @closetool @sagilio |
@TJM can you make a PR to support it? |
@hsluoyz I tried, but failed. :( I use sqlite for local development. I have tried with both the 'c' implementation and this golang implementation. They both work fine for my application, which uses gorm, but I get an error about "id" fields when I try to use it for casbin. The funny part is that it works fine the first time you start, but the second time you start the app (where the database has already been populated) and it tries to create the enforcer, this error comes up:
SO, it doesn't do any good to add it to the (internal?) supported databases. There is apparently some other problem relating to "id" column. Honestly, I don't think that this code should have any direct support for databases. It should just take the gorm.DB and use whatever gorm supports. :) ... that way I could reduce the amount of imported code for the other N databases that I have no intention of using :) ~tommy |
@TJM I found the bug was because of this line of code. Line 377 in 34e13d4
See AutoMigrate bug. Since glebarez/sqlite is too backward and has not been updated, this PR cannot be implemented at present. Regarding your second question, I don't quite understand what it means. If you have a better idea, you can open a new PR |
Actually it is not falling backwards. |
@TJM does your case fail with both CGo and pure-Go implementations? Or is it just Pure-Go fails ? |
@glebarez Yes, you are right, I ignore that. If so, when this bug is resolved I'd be gald to implement our functionality based on it. |
created an issue go-gorm/gorm#5282 to the upstream. |
I fixed this issue in https://github.com/glebarez/sqlite |
You guys rock! Thanks! I am passing it a glebarez/sqlite |
@glebarez thanks. It works. |
🎉 This issue has been resolved in version 3.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
I propose that sqlite should be supported, perhaps using this implementation:
"github.com/glebarez/sqlite"
REF: https://gorm.io/docs/connecting_to_the_database.html#SQLite
The text was updated successfully, but these errors were encountered: