Giter Club home page Giter Club logo

Comments (11)

aofengli avatar aofengli commented on May 20, 2024

I don’t quite understand why you don’t increase the primary key field. According to the mysql innodb index design, it is recommended to provide an ID primary key

from gorm-adapter.

nodece avatar nodece commented on May 20, 2024

I guess the Casbin don't need the ID primary key.

from gorm-adapter.

hsluoyz avatar hsluoyz commented on May 20, 2024

@aofengli can you make a PR to add an increment primary key?

from gorm-adapter.

hsluoyz avatar hsluoyz commented on May 20, 2024

@00LT00 can you take this issue?

from gorm-adapter.

00LT00 avatar 00LT00 commented on May 20, 2024

I'm learning about it and solving it as soon as possible

from gorm-adapter.

00LT00 avatar 00LT00 commented on May 20, 2024
  1. When casbin is loaded, it has already loaded from database to memory. So the database is not selected during runtime. The primary key has no effect on select operations.
  2. Because the gorm-adapter just is a tool to get policy. The struct in memory must be the same as "policy.csv". In fact, the primary key cannot be used at all when deleting.

In summary, I think we shouldn't add ID primary key for casbin.
What do you think? @aofengli @hsluoyz

from gorm-adapter.

hsluoyz avatar hsluoyz commented on May 20, 2024

I don’t quite understand why you don’t increase the primary key field. According to the mysql innodb index design, it is recommended to provide an ID primary key

@aofengli can you make a PR to fix it?

from gorm-adapter.

nodece avatar nodece commented on May 20, 2024

@hsluoyz We should add unique index.

from gorm-adapter.

hsluoyz avatar hsluoyz commented on May 20, 2024

OK. Can anyone work on a PR?

from gorm-adapter.

00LT00 avatar 00LT00 commented on May 20, 2024

@hsluoyz @nodece add unique index

from gorm-adapter.

hsluoyz avatar hsluoyz commented on May 20, 2024

PR made: #54

from gorm-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.