{"id":31017290,"url":"https://github.com/pmdevita/nextcord-ormar","last_synced_at":"2026-05-18T09:07:48.565Z","repository":{"id":49169357,"uuid":"432378583","full_name":"pmdevita/nextcord-ormar","owner":"pmdevita","description":"Database integration for Nextcord with Ormar","archived":false,"fork":false,"pushed_at":"2023-07-13T02:51:19.000Z","size":351,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-27T04:36:20.306Z","etag":null,"topics":["asyncio","discord","nextcord","ormar","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmdevita.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-27T05:40:40.000Z","updated_at":"2023-07-18T09:08:30.000Z","dependencies_parsed_at":"2023-02-10T04:00:44.573Z","dependency_job_id":null,"html_url":"https://github.com/pmdevita/nextcord-ormar","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pmdevita/nextcord-ormar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmdevita%2Fnextcord-ormar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmdevita%2Fnextcord-ormar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmdevita%2Fnextcord-ormar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmdevita%2Fnextcord-ormar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmdevita","download_url":"https://codeload.github.com/pmdevita/nextcord-ormar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmdevita%2Fnextcord-ormar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33172173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","discord","nextcord","ormar","python"],"created_at":"2025-09-13T07:53:55.460Z","updated_at":"2026-05-18T09:07:48.560Z","avatar_url":"https://github.com/pmdevita.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nextcord-Ormar\n\n[![Documentation Status](https://readthedocs.org/projects/nextcord-ormar/badge/?version=latest\u0026style=for-the-badge)](https://nextcord-ormar.readthedocs.io/en/latest/?badge=latest)\n\n[Formerly Nextcord-Tortoise](docs/goodbye-tortoise.md)\n\n---\n\nNextcord-Ormar is being sunset for its spiritual successor, [hikari-atsume](https://github.com/pmdevita/nextcord-ormar).\n\n---\n\n\nNextcord-Ormar is a library to help integrate the async Django-inspired ORM\n[Ormar](https://github.com/collerek/ormar) with a [Nextcord](https://github.com/nextcord/nextcord/) bot. It's \ndesigned to compliment the modular cog system of Nextcord. It also comes with NXAlembic, a preconfigured version of\n[Alembic](https://github.com/sqlalchemy/alembic) to help with creating and applying database migrations.\n\nNextcord-Ormar is still in active development, there may be breaking changes as the library is polished up. If you have \nany feedback, feel free to open an issue!\n\n## Quickstart\n\nInstall Nextcord-Ormar and Ormar with the correct [database backend](https://collerek.github.io/ormar/install/).\n\n```shell\npip install nextcord-ormar ormar[sqlite]\n```\n\n\nImport Nextcord-Ormar's bot class and pass it your [database URL](https://nextcord-ormar.readthedocs.io/en/latest/connections.html).\n\n```python\nfrom nextcord_ormar import Bot\n\nbot = Bot(command_prefix=\"$\", database_url=\"sqlite:///db.sqlite\")\n```\n\nIn your cog file, import OrmarApp to create an app, then use AppModel to create a database model. Define your model \nlike a [normal Ormar model](https://collerek.github.io/ormar/models/).\n\nIf you prefer, you can also define your models elsewhere and import them into your cog.\n\n```python\nimport ormar\nfrom nextcord_ormar import OrmarApp, AppModel\n\nModelMeta = OrmarApp.create_app(\"example\")\n\nclass ExampleTable(AppModel):\n    class Meta(ModelMeta):\n        pass\n    \n    id = ormar.Integer(primary_key=True)\n    discord_id = ormar.BigInteger()\n    message = ormar.Text()\n```\n\nYou can then use this model in your cog.\n\n```python\nfrom nextcord.ext import commands\n\nclass Example(commands.Cog):\n    def __init__(self, nextcord):\n        self.nextcord = nextcord\n\n    @commands.command(\"example\")\n    async def example(self, ctx: commands.Context, *args):\n        new_example = await ExampleTable.objects.create(discord_id=ctx.author.id, message=args[0])\n        await ctx.send(\"Hello!\")\n```\n\nBefore you can start the bot though, you'll need to set up migrations and the database. Create a file called \n`nxalembic.ini` in your project root folder and tell it how to import your bot.\n\n```ini\n[nxalembic]\nmodule = example.demo\nbot = bot\n```\n\nYou can think of this as `from module import bot`, or in this instance, `from example.demo import bot`. NXAlembic will \nuse it to import your bot along with your definitions for each model.\n\nIn the same folder, you can now use the `nxalembic` tool. Create migrations with\n\n```shell\nnxalembic migrate\n```\n\nUpgrade the database\n\n```shell\nnxalembic update\n```\n\nYour bot is now ready to start!\n\n\n### Roadmap\n\nOther than bug fixes as they arise, the current plan is to just add the rest of the Alembic commands to NXAlembic. \nIf there is a specific feature you want that is missing from either the bot integration or NXAlembic, feel free to \nopen an issue.\n\n### Thanks to\n\nMiguel Grinberg for [Flask-Migrations](https://github.com/miguelgrinberg/Flask-Migrate) which was a useful example.\n\n[Mike Bayer](https://github.com/zzzeek) for [SQLAlchemy](https://www.sqlalchemy.org/) and [Alembic](https://github.com/sqlalchemy/alembic/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmdevita%2Fnextcord-ormar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmdevita%2Fnextcord-ormar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmdevita%2Fnextcord-ormar/lists"}