Comments (3)
Hi @HaoweiCh , it seems that Gorm's DropTable()
fails to delete the table for MariaDB, maybe the SQL syntax is wrong for MariaDB. Can you provide a runnable example and your MariaDB version? So I can install the MariaDB and run your code to debug it.
Lines 162 to 167 in e74a050
from gorm-adapter.
func init() {
DB = Connect(
"123.106.169.37:3306",
"p",
"spiders",
).Set("gorm:table_options", "CHARSET=utf8")
}
func Connect(hostAndPort, userNameAndPassword, databaseName string) (db *gorm.DB) {
var err error
if db, err = gorm.Open("mysql",
fmt.Sprintf("%s@tcp(%s)/%s?charset=utf8mb4&collation=utf8mb4_unicode_ci&parseTime=true&loc=Local",
userNameAndPassword, hostAndPort, databaseName)); err != nil {
panic(err)
}
return
}
I guess .Set("gorm:table_options", "CHARSET=utf8")
may cause this problem. but even remove it problem exists
10.3.13-MariaDB
if this info cannot help, I'll try provide more.
Even when this err issued, the data 've already wrote into database,,
from gorm-adapter.
This is not an issue of this repo. You should ask in in Gorm's issue tracker.
from gorm-adapter.
Related Issues (20)
- Loading multiple policy types. HOT 3
- change default v7 to v5 HOT 9
- [Proposal] customizability CasbinRule structure HOT 2
- question: dbspecified not works when specify dbname in dsn HOT 4
- [bug] Resolver mysql HOT 5
- there is a problem with the processing of error HOT 2
- Support SQL Server in gorm-adapter HOT 1
- [suggest]No physical deletion HOT 2
- [feature] create if not exist for Update APIs HOT 6
- "accessible by" feature for ORM integrations HOT 4
- Support for connection pools HOT 4
- Adapter Transaction db table can not set HOT 2
- why not use Transaction to SavePolicy HOT 6
- Understanding how to correctly update policies in a database HOT 4
- [Question] Handle to handle policy_definition has more than 6 items HOT 4
- How to setup a casbin watcher along with the the Gorm adapter HOT 4
- Add GetImplicitUsersForResourceByDomain() API HOT 2
- use RemovePolicy() API Debug HOT 3
- policy get loaded twice HOT 4
- id increase when savePolicy HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gorm-adapter.