Skip to content

Commit

Permalink
feat: replace declarative_base -> DeclarativeBase for sqlalchemy 2.0 …
Browse files Browse the repository at this point in the history
…migration (#65)

* Replace declarative_base -> DeclarativeBase for sqlalchemy 2.0 migration

* Update adapter.py

---------

Co-authored-by: Eric Luo <hsluoyz@qq.com>
  • Loading branch information
jimmyyyeh and hsluoyz authored Mar 1, 2024
1 parent 78edd93 commit a737cd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions casbin_sqlalchemy_adapter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from casbin import persist
from sqlalchemy import Column, Integer, String
from sqlalchemy import create_engine, or_
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import sessionmaker, DeclarativeBase

Base = declarative_base()
# declarative base class
class Base(DeclarativeBase):
pass


class CasbinRule(Base):
Expand Down

0 comments on commit a737cd8

Please # to comment.