Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

Documents the create_casbin_rule_model() function added in #22 for managing CasbinRule table schema through Alembic migrations.

Changes

  • Added "Alembic Integration" section showing how to use create_casbin_rule_model() with application's declarative base
  • Included example of passing custom model to adapter via db_class parameter
  • Fixed typo: AsyncAdaper → AsyncAdapter, AynscEnforcer → AsyncEnforcer

Usage

# Define model in your app using your declarative base
from casbin_async_sqlalchemy_adapter import create_casbin_rule_model
CasbinRule = create_casbin_rule_model(Base)

# Alembic can now auto-generate migrations
# alembic revision --autogenerate -m "Add casbin_rule table"

# Use custom model with adapter
adapter = casbin_async_sqlalchemy_adapter.Adapter(
    'sqlite+aiosqlite:///test.db',
    db_class=CasbinRule
)
Original prompt

This section details on the original issue you should resolve

<issue_title>[docs] add docs for the PR</issue_title>
<issue_description>Improve the README.md based on the newly merged PR: #22
You should write high-quality human-like docs for a modern OSS software. Don't write in the GPT-flavor. Don't write too long, keep it tidy docs. Don't use itemized list to describe things like "Use Cases", "Best practice" or "what it can do"
Don't add too long text, keep it short and to the point</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 7, 2025 14:32
Co-authored-by: mserico <140243407+mserico@users.noreply.github.com>
Co-authored-by: mserico <140243407+mserico@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for the newly merged PR Add Alembic integration documentation for create_casbin_rule_model() Dec 7, 2025
Copilot AI requested a review from mserico December 7, 2025 14:35
@mserico mserico marked this pull request as ready for review December 7, 2025 14:44
@mserico mserico changed the title Add Alembic integration documentation for create_casbin_rule_model() fix: add Alembic integration docs for create_casbin_rule_model() Dec 7, 2025
@mserico mserico merged commit 77b24f0 into master Dec 7, 2025
5 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 7, 2025
## [1.16.1](v1.16.0...v1.16.1) (2025-12-07)

### Bug Fixes

* add Alembic integration docs for create_casbin_rule_model() ([#24](#24)) ([06e3f37](06e3f37))
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.

[docs] add docs for the PR

2 participants