nexus-framework 0.2.8__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/PKG-INFO +1 -1
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/pyproject.toml +1 -1
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/__init__.py +1 -1
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/__init__.py +4 -0
- nexus_framework-0.3.0/src/nexus/console/commands/db_reverse.py +369 -0
- nexus_framework-0.3.0/src/nexus/console/commands/install_tools.py +193 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/kernel.py +4 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/connection.py +4 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/schema/blueprint.py +27 -0
- nexus_framework-0.3.0/src/nexus/database/studio/__init__.py +7 -0
- nexus_framework-0.3.0/src/nexus/database/studio/manager.py +494 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/foundation/application.py +4 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/request.py +20 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/routing/router.py +84 -24
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/starters/standard.py +103 -44
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/telescope/telescope.py +23 -2
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus_framework.egg-info/PKG-INFO +1 -1
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus_framework.egg-info/SOURCES.txt +4 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/README.md +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/setup.cfg +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/application.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/access/gate.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/auth_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/authenticatable.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/guard.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/hashing.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/middleware.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/sanctum/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/sanctum/guard.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/sanctum/has_api_tokens.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/sanctum/middleware.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/sanctum/migration.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/sanctum/new_access_token.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/sanctum/personal_access_token.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/auth/user_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/cache/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/cache/cache_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/cache/driver.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/cache/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/cache/store.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/config/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/config/repository.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/cli.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/command.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/clear.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/config.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/database.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/key_generate.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/make.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/new_command.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/queue.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/route_list.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/schedule.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/serve.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/starter.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/commands/tinker.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/console_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/generators/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/console/generators/stubs.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/container/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/container/container.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/container/exceptions.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/database_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/factory.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/migrations/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/migrations/migration.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/migrations/migrator.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/exceptions.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/model.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/relations/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/relations/base.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/relations/belongs_to.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/relations/belongs_to_many.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/relations/has_many.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/relations/has_one.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/models/soft_deletes.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/query/builder.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/schema/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/schema/schema.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/database/seeder.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/events/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/events/dispatcher.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/events/event_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/exceptions/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/exceptions/exception_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/exceptions/handler.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/app.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/artisan.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/auth.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/cache.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/config.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/date.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/db.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/event.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/facade.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/gate.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/hash.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/inertia.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/log.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/mail.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/notification.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/queue.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/rate_limiter.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/request.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/route.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/schedule.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/schema.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/session.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/storage.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/telescope.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/url.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/validator.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/facades/view.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/filesystem/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/filesystem/driver.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/filesystem/filesystem_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/filesystem/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/foundation/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/foundation/provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/foundation/runner.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/foundation/service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/exceptions.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/middleware.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/requests/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/requests/form_request.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/resources/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/resources/json_resource.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/resources/resource_collection.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/response.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/http/uploaded_file.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/inertia/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/inertia/helpers.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/inertia/inertia.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/inertia/inertia_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/inertia/lazy.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/inertia/middleware.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/inertia/response.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/logging/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/logging/logging_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/logging/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/mail/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/mail/mail_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/mail/mailable.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/mail/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/mail/transport.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/notifications/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/notifications/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/notifications/notification.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/notifications/notification_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/py.typed +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/queue/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/queue/driver.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/queue/job.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/queue/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/queue/queue_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/queue/worker.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/routing/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/routing/limiter.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/routing/route.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/routing/throttle.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/routing/url.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/schedule/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/schedule/event.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/schedule/schedule.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/schedule/schedule_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/security/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/security/cors.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/security/csrf.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/security/headers.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/session/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/session/driver.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/session/manager.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/session/middleware.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/session/session.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/session/session_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/starters/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/starters/api.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/starters/inertia.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/starters/openapi.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/starters/web.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/support/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/support/arr.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/support/carbon.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/support/collection.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/support/env.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/support/helpers.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/support/str.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/telescope/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/telescope/debugbar.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/telescope/entry.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/telescope/middleware.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/telescope/telescope_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/client.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/database.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/fakes/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/fakes/event_fake.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/fakes/log_fake.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/fakes/mail_fake.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/fakes/notification_fake.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/fakes/queue_fake.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/fakes/storage_fake.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/response.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/test_case.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/testing/time.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/validation/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/validation/rule.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/validation/validation_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/validation/validator.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/view/__init__.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/view/compiler.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/view/factory.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus/view/view_service_provider.py +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus_framework.egg-info/dependency_links.txt +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus_framework.egg-info/entry_points.txt +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus_framework.egg-info/requires.txt +0 -0
- {nexus_framework-0.2.8 → nexus_framework-0.3.0}/src/nexus_framework.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nexus-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: An expressive, batteries-included asynchronous web framework for Python inspired by Laravel.
|
|
5
5
|
Author-email: Nexus Core Team <core@nexus-framework.org>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nexus-framework"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "An expressive, batteries-included asynchronous web framework for Python inspired by Laravel."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -5,6 +5,8 @@ from __future__ import annotations
|
|
|
5
5
|
from nexus.console.commands.clear import register_clear_commands
|
|
6
6
|
from nexus.console.commands.config import register_config_commands
|
|
7
7
|
from nexus.console.commands.database import register_database_commands
|
|
8
|
+
from nexus.console.commands.db_reverse import register_db_reverse_command
|
|
9
|
+
from nexus.console.commands.install_tools import register_tool_install_commands
|
|
8
10
|
from nexus.console.commands.key_generate import register_key_commands
|
|
9
11
|
from nexus.console.commands.make import register_make_commands
|
|
10
12
|
from nexus.console.commands.new_command import register_new_command
|
|
@@ -19,6 +21,7 @@ __all__ = [
|
|
|
19
21
|
"register_clear_commands",
|
|
20
22
|
"register_config_commands",
|
|
21
23
|
"register_database_commands",
|
|
24
|
+
"register_db_reverse_command",
|
|
22
25
|
"register_key_commands",
|
|
23
26
|
"register_make_commands",
|
|
24
27
|
"register_new_command",
|
|
@@ -28,4 +31,5 @@ __all__ = [
|
|
|
28
31
|
"register_serve_command",
|
|
29
32
|
"register_starter_commands",
|
|
30
33
|
"register_tinker_command",
|
|
34
|
+
"register_tool_install_commands",
|
|
31
35
|
]
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
"""Nexus Database Reverse Engineering Command.
|
|
2
|
+
|
|
3
|
+
Inspects an existing database and generates standard migrations and Eloquent models
|
|
4
|
+
with automatic Pivot table detection and relationship wiring.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import datetime
|
|
10
|
+
from typing import TYPE_CHECKING, Any
|
|
11
|
+
|
|
12
|
+
import typer
|
|
13
|
+
from rich.console import Console
|
|
14
|
+
from rich.panel import Panel
|
|
15
|
+
from rich.table import Table
|
|
16
|
+
from sqlalchemy import inspect
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from nexus.foundation.application import Application
|
|
20
|
+
|
|
21
|
+
console = Console()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _singularize(word: str) -> str:
|
|
25
|
+
"""Simple English singularization for table names."""
|
|
26
|
+
w = word.lower()
|
|
27
|
+
if w.endswith("ies") and len(w) > 3:
|
|
28
|
+
return w[:-3] + "y"
|
|
29
|
+
if w.endswith(("ses", "xes", "shes", "ches")):
|
|
30
|
+
return w[:-2]
|
|
31
|
+
if w.endswith("s") and not w.endswith("ss") and len(w) > 1:
|
|
32
|
+
return w[:-1]
|
|
33
|
+
return w
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _to_pascal(name: str) -> str:
|
|
37
|
+
"""Convert snake_case table name to PascalCase model name."""
|
|
38
|
+
singular = _singularize(name)
|
|
39
|
+
parts = singular.split("_")
|
|
40
|
+
return "".join(p.capitalize() for p in parts)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _to_camel_or_snake(name: str) -> str:
|
|
44
|
+
"""Convert to snake_case."""
|
|
45
|
+
return name.lower()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def reverse_engineer_database(
|
|
49
|
+
app: Application,
|
|
50
|
+
connection_name: str | None = None,
|
|
51
|
+
migrations_dir: str = "database/migrations",
|
|
52
|
+
models_dir: str = "app/models",
|
|
53
|
+
force: bool = False,
|
|
54
|
+
) -> dict[str, Any]:
|
|
55
|
+
"""Inspect active database and generate migrations and Eloquent models with pivot detection."""
|
|
56
|
+
if not app.has("db"):
|
|
57
|
+
raise RuntimeError("Database manager [db] is not bound in application.")
|
|
58
|
+
|
|
59
|
+
db: Any = app.make("db")
|
|
60
|
+
conn = db.connection(connection_name) if hasattr(db, "connection") else db.engine(connection_name)
|
|
61
|
+
if hasattr(conn, "get_engine"):
|
|
62
|
+
engine = conn.get_engine()
|
|
63
|
+
elif hasattr(conn, "engine"):
|
|
64
|
+
engine = conn.engine
|
|
65
|
+
else:
|
|
66
|
+
engine = conn
|
|
67
|
+
|
|
68
|
+
inspector = inspect(engine)
|
|
69
|
+
all_tables = [t for t in inspector.get_table_names() if t not in ("migrations", "sqlite_sequence")]
|
|
70
|
+
if not all_tables:
|
|
71
|
+
return {"migrations": [], "models": [], "tables": {}}
|
|
72
|
+
|
|
73
|
+
mig_path = app.base_path(migrations_dir)
|
|
74
|
+
mod_path = app.base_path(models_dir)
|
|
75
|
+
mig_path.mkdir(parents=True, exist_ok=True)
|
|
76
|
+
mod_path.mkdir(parents=True, exist_ok=True)
|
|
77
|
+
|
|
78
|
+
# 1. Analyze all tables, columns, foreign keys, and classify Base vs Pivot
|
|
79
|
+
table_meta: dict[str, dict[str, Any]] = {}
|
|
80
|
+
pivot_tables: dict[str, dict[str, str]] = {} # pivot_name -> {table_a, table_b}
|
|
81
|
+
|
|
82
|
+
for t in all_tables:
|
|
83
|
+
columns = inspector.get_columns(t)
|
|
84
|
+
fks = inspector.get_foreign_keys(t)
|
|
85
|
+
pk = inspector.get_pk_constraint(t)
|
|
86
|
+
pk_cols = pk.get("constrained_columns", [])
|
|
87
|
+
|
|
88
|
+
is_pivot = False
|
|
89
|
+
parents = []
|
|
90
|
+
if len(fks) == 2:
|
|
91
|
+
t1, t2 = fks[0].get("referred_table"), fks[1].get("referred_table")
|
|
92
|
+
if t1 and t2 and t1 != t2 and t1 in all_tables and t2 in all_tables:
|
|
93
|
+
fk_col_names = set(fks[0].get("constrained_columns", []) + fks[1].get("constrained_columns", []))
|
|
94
|
+
extra_cols = [
|
|
95
|
+
c["name"] for c in columns
|
|
96
|
+
if c["name"] not in fk_col_names and c["name"] not in ("id", "created_at", "updated_at")
|
|
97
|
+
]
|
|
98
|
+
if len(extra_cols) == 0:
|
|
99
|
+
is_pivot = True
|
|
100
|
+
parents = [t1, t2]
|
|
101
|
+
pivot_tables[t] = {
|
|
102
|
+
"table_a": t1,
|
|
103
|
+
"table_b": t2,
|
|
104
|
+
"col_a": fks[0]["constrained_columns"][0],
|
|
105
|
+
"col_b": fks[1]["constrained_columns"][0],
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
table_meta[t] = {
|
|
109
|
+
"name": t,
|
|
110
|
+
"is_pivot": is_pivot,
|
|
111
|
+
"parents": parents,
|
|
112
|
+
"columns": columns,
|
|
113
|
+
"pk_cols": pk_cols,
|
|
114
|
+
"fks": fks,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# 2. Generate Migrations
|
|
118
|
+
base_timestamp = datetime.datetime.now(datetime.UTC)
|
|
119
|
+
generated_migrations: list[str] = []
|
|
120
|
+
|
|
121
|
+
for idx, (t_name, meta) in enumerate(table_meta.items()):
|
|
122
|
+
time_str = (base_timestamp + datetime.timedelta(seconds=idx)).strftime("%Y_%m_%d_%H%M%S")
|
|
123
|
+
mig_filename = f"{time_str}_create_{t_name}_table.py"
|
|
124
|
+
target_mig_file = mig_path / mig_filename
|
|
125
|
+
|
|
126
|
+
if target_mig_file.exists() and not force:
|
|
127
|
+
continue
|
|
128
|
+
|
|
129
|
+
class_name = f"Create{_to_pascal(t_name)}Table"
|
|
130
|
+
lines: list[str] = []
|
|
131
|
+
has_created_at = any(c["name"] == "created_at" for c in meta["columns"])
|
|
132
|
+
has_updated_at = any(c["name"] == "updated_at" for c in meta["columns"])
|
|
133
|
+
has_timestamps = has_created_at and has_updated_at
|
|
134
|
+
|
|
135
|
+
for col in meta["columns"]:
|
|
136
|
+
c_name = col["name"]
|
|
137
|
+
if has_timestamps and c_name in ("created_at", "updated_at"):
|
|
138
|
+
continue
|
|
139
|
+
|
|
140
|
+
c_type_str = str(col["type"]).lower()
|
|
141
|
+
nullable = col.get("nullable", True)
|
|
142
|
+
|
|
143
|
+
# Check if this column is a foreign key
|
|
144
|
+
matching_fk = next((fk for fk in meta["fks"] if c_name in fk.get("constrained_columns", [])), None)
|
|
145
|
+
|
|
146
|
+
if c_name == "id" and c_name in meta["pk_cols"]:
|
|
147
|
+
lines.append(" table.id()")
|
|
148
|
+
elif matching_fk:
|
|
149
|
+
ref_table = matching_fk["referred_table"]
|
|
150
|
+
lines.append(f' table.foreign_id("{c_name}").constrained("{ref_table}").cascade_on_delete()')
|
|
151
|
+
elif "int" in c_type_str:
|
|
152
|
+
method = "big_integer" if "big" in c_type_str else "integer"
|
|
153
|
+
decl = f' table.{method}("{c_name}")'
|
|
154
|
+
if nullable:
|
|
155
|
+
decl += ".nullable()"
|
|
156
|
+
lines.append(decl)
|
|
157
|
+
elif "bool" in c_type_str:
|
|
158
|
+
decl = f' table.boolean("{c_name}")'
|
|
159
|
+
if nullable:
|
|
160
|
+
decl += ".nullable()"
|
|
161
|
+
lines.append(decl)
|
|
162
|
+
elif "text" in c_type_str or "clob" in c_type_str:
|
|
163
|
+
decl = f' table.text("{c_name}")'
|
|
164
|
+
if nullable:
|
|
165
|
+
decl += ".nullable()"
|
|
166
|
+
lines.append(decl)
|
|
167
|
+
elif "numeric" in c_type_str or "decimal" in c_type_str or "float" in c_type_str:
|
|
168
|
+
decl = f' table.decimal("{c_name}")'
|
|
169
|
+
if nullable:
|
|
170
|
+
decl += ".nullable()"
|
|
171
|
+
lines.append(decl)
|
|
172
|
+
elif "json" in c_type_str:
|
|
173
|
+
decl = f' table.json("{c_name}")'
|
|
174
|
+
if nullable:
|
|
175
|
+
decl += ".nullable()"
|
|
176
|
+
lines.append(decl)
|
|
177
|
+
elif "date" in c_type_str or "time" in c_type_str:
|
|
178
|
+
decl = f' table.timestamp("{c_name}")'
|
|
179
|
+
if nullable:
|
|
180
|
+
decl += ".nullable()"
|
|
181
|
+
lines.append(decl)
|
|
182
|
+
else:
|
|
183
|
+
decl = f' table.string("{c_name}")'
|
|
184
|
+
if nullable:
|
|
185
|
+
decl += ".nullable()"
|
|
186
|
+
lines.append(decl)
|
|
187
|
+
|
|
188
|
+
if has_timestamps:
|
|
189
|
+
lines.append(" table.timestamps()")
|
|
190
|
+
|
|
191
|
+
schema_body = "\n".join(lines) if lines else " pass"
|
|
192
|
+
|
|
193
|
+
migration_code = f'''"""Migration: Create {t_name} table."""
|
|
194
|
+
|
|
195
|
+
from __future__ import annotations
|
|
196
|
+
|
|
197
|
+
from nexus.database.migrations.migration import Migration
|
|
198
|
+
from nexus.database.schema.blueprint import Blueprint
|
|
199
|
+
from nexus.database.schema.schema import Schema
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class {class_name}(Migration):
|
|
203
|
+
"""Create {t_name} table schema."""
|
|
204
|
+
|
|
205
|
+
def up(self, schema: Schema) -> None:
|
|
206
|
+
def table_definition(table: Blueprint) -> None:
|
|
207
|
+
{schema_body}
|
|
208
|
+
|
|
209
|
+
schema.create("{t_name}", table_definition)
|
|
210
|
+
|
|
211
|
+
def down(self, schema: Schema) -> None:
|
|
212
|
+
schema.drop_if_exists("{t_name}")
|
|
213
|
+
'''
|
|
214
|
+
target_mig_file.write_text(migration_code, encoding="utf-8")
|
|
215
|
+
generated_migrations.append(mig_filename)
|
|
216
|
+
|
|
217
|
+
# 3. Generate Eloquent Models (Only for Base tables, NOT pivot tables)
|
|
218
|
+
generated_models: list[str] = []
|
|
219
|
+
|
|
220
|
+
for t_name, meta in table_meta.items():
|
|
221
|
+
if meta["is_pivot"]:
|
|
222
|
+
continue # Pivot tables do not get independent Models
|
|
223
|
+
|
|
224
|
+
model_name = _to_pascal(t_name)
|
|
225
|
+
target_model_file = mod_path / f"{_singularize(t_name)}.py"
|
|
226
|
+
|
|
227
|
+
if target_model_file.exists() and not force:
|
|
228
|
+
continue
|
|
229
|
+
|
|
230
|
+
relations_code: list[str] = []
|
|
231
|
+
rel_imports: set[str] = set()
|
|
232
|
+
|
|
233
|
+
# Check BelongsTo relations (Foreign keys on this table)
|
|
234
|
+
for fk in meta["fks"]:
|
|
235
|
+
ref_table = fk.get("referred_table")
|
|
236
|
+
if ref_table and ref_table in table_meta and not table_meta[ref_table]["is_pivot"]:
|
|
237
|
+
target_model = _to_pascal(ref_table)
|
|
238
|
+
method_name = _singularize(ref_table)
|
|
239
|
+
rel_imports.add("from nexus.database.models.relations.belongs_to import BelongsTo")
|
|
240
|
+
relations_code.append(
|
|
241
|
+
f' def {method_name}(self) -> BelongsTo:\n'
|
|
242
|
+
f' from app.models.{target_model.lower()} import {target_model}\n'
|
|
243
|
+
f' return self.belongs_to({target_model})'
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
# Check HasMany relations (Other base tables pointing to this table)
|
|
247
|
+
for other_t, other_meta in table_meta.items():
|
|
248
|
+
if other_t != t_name and not other_meta["is_pivot"]:
|
|
249
|
+
for other_fk in other_meta["fks"]:
|
|
250
|
+
if other_fk.get("referred_table") == t_name:
|
|
251
|
+
target_model = _to_pascal(other_t)
|
|
252
|
+
method_name = other_t
|
|
253
|
+
rel_imports.add("from nexus.database.models.relations.has_many import HasMany")
|
|
254
|
+
relations_code.append(
|
|
255
|
+
f' def {method_name}(self) -> HasMany:\n'
|
|
256
|
+
f' from app.models.{_singularize(other_t)} import {target_model}\n'
|
|
257
|
+
f' return self.has_many({target_model})'
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
# Check BelongsToMany (Pivot tables referencing this table)
|
|
261
|
+
for p_name, p_info in pivot_tables.items():
|
|
262
|
+
if p_info["table_a"] == t_name:
|
|
263
|
+
other_t = p_info["table_b"]
|
|
264
|
+
target_model = _to_pascal(other_t)
|
|
265
|
+
method_name = other_t
|
|
266
|
+
rel_imports.add("from nexus.database.models.relations.belongs_to_many import BelongsToMany")
|
|
267
|
+
relations_code.append(
|
|
268
|
+
f' def {method_name}(self) -> BelongsToMany:\n'
|
|
269
|
+
f' from app.models.{_singularize(other_t)} import {target_model}\n'
|
|
270
|
+
f' return self.belongs_to_many({target_model}, table="{p_name}")'
|
|
271
|
+
)
|
|
272
|
+
elif p_info["table_b"] == t_name:
|
|
273
|
+
other_t = p_info["table_a"]
|
|
274
|
+
target_model = _to_pascal(other_t)
|
|
275
|
+
method_name = other_t
|
|
276
|
+
rel_imports.add("from nexus.database.models.relations.belongs_to_many import BelongsToMany")
|
|
277
|
+
relations_code.append(
|
|
278
|
+
f' def {method_name}(self) -> BelongsToMany:\n'
|
|
279
|
+
f' from app.models.{_singularize(other_t)} import {target_model}\n'
|
|
280
|
+
f' return self.belongs_to_many({target_model}, table="{p_name}")'
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
imports_block = "\n".join(sorted(rel_imports))
|
|
284
|
+
if imports_block:
|
|
285
|
+
imports_block += "\n"
|
|
286
|
+
|
|
287
|
+
methods_block = "\n\n".join(relations_code) if relations_code else " pass"
|
|
288
|
+
|
|
289
|
+
model_code = f'''"""Eloquent Model for {t_name}."""
|
|
290
|
+
|
|
291
|
+
from __future__ import annotations
|
|
292
|
+
|
|
293
|
+
from typing import TYPE_CHECKING
|
|
294
|
+
from nexus.database.models.model import Model
|
|
295
|
+
{imports_block}
|
|
296
|
+
|
|
297
|
+
class {model_name}(Model):
|
|
298
|
+
"""Active Record Eloquent Model for {t_name} table."""
|
|
299
|
+
|
|
300
|
+
table: str = "{t_name}"
|
|
301
|
+
|
|
302
|
+
{methods_block}
|
|
303
|
+
'''
|
|
304
|
+
target_model_file.write_text(model_code, encoding="utf-8")
|
|
305
|
+
generated_models.append(model_name)
|
|
306
|
+
|
|
307
|
+
return {
|
|
308
|
+
"migrations": generated_migrations,
|
|
309
|
+
"models": generated_models,
|
|
310
|
+
"tables": table_meta,
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def register_db_reverse_command(cli: typer.Typer, app: Application) -> None:
|
|
315
|
+
"""Register the db:reverse command on the Artisan CLI."""
|
|
316
|
+
|
|
317
|
+
@cli.command("db:reverse", help="Reverse engineer migrations and models from an existing database")
|
|
318
|
+
def db_reverse(
|
|
319
|
+
connection_name: str | None = typer.Option(None, "--connection", "-c", help="Database connection name to inspect"),
|
|
320
|
+
migrations_dir: str = typer.Option("database/migrations", "--migrations-dir", help="Directory where migrations will be generated"),
|
|
321
|
+
models_dir: str = typer.Option("app/models", "--models-dir", help="Directory where models will be generated"),
|
|
322
|
+
force: bool = typer.Option(False, "--force", "-f", help="Overwrite existing migration and model files"),
|
|
323
|
+
) -> None:
|
|
324
|
+
"""Inspect active database and generate migrations and Eloquent models with pivot detection."""
|
|
325
|
+
console.print("[bold cyan]🔍 Connecting to database and introspecting schema...[/bold cyan]")
|
|
326
|
+
try:
|
|
327
|
+
result = reverse_engineer_database(
|
|
328
|
+
app,
|
|
329
|
+
connection_name=connection_name,
|
|
330
|
+
migrations_dir=migrations_dir,
|
|
331
|
+
models_dir=models_dir,
|
|
332
|
+
force=force,
|
|
333
|
+
)
|
|
334
|
+
except Exception as exc:
|
|
335
|
+
console.print(f"[bold red]Database inspection failed:[/bold red] {exc}")
|
|
336
|
+
raise typer.Exit(code=1) from exc
|
|
337
|
+
|
|
338
|
+
table_meta = result["tables"]
|
|
339
|
+
if not table_meta:
|
|
340
|
+
console.print("[yellow]No tables found in the database to reverse engineer.[/yellow]")
|
|
341
|
+
return
|
|
342
|
+
|
|
343
|
+
# Display Results Table
|
|
344
|
+
table_summary = Table(title="⚡ Nexus Database Reverse Engineering Summary", border_style="cyan")
|
|
345
|
+
table_summary.add_column("Table Name", style="bold white")
|
|
346
|
+
table_summary.add_column("Classification", style="bold")
|
|
347
|
+
table_summary.add_column("Columns", style="dim")
|
|
348
|
+
table_summary.add_column("Relations / Parents", style="cyan")
|
|
349
|
+
|
|
350
|
+
for t_name, meta in table_meta.items():
|
|
351
|
+
if meta["is_pivot"]:
|
|
352
|
+
kind = "[purple]🔗 Pivot Table[/purple]"
|
|
353
|
+
rel_info = f"Connects: {meta['parents'][0]} <-> {meta['parents'][1]}"
|
|
354
|
+
else:
|
|
355
|
+
kind = "[green]📦 Base Table[/green]"
|
|
356
|
+
rel_info = f"Model: {models_dir}/{_to_pascal(t_name)}.py"
|
|
357
|
+
|
|
358
|
+
table_summary.add_row(t_name, kind, str(len(meta["columns"])), rel_info)
|
|
359
|
+
|
|
360
|
+
console.print(table_summary)
|
|
361
|
+
console.print(
|
|
362
|
+
Panel(
|
|
363
|
+
f"[bold green]✓ Successfully reverse-engineered database schema![/bold green]\n\n"
|
|
364
|
+
f"• Generated [bold cyan]{len(result['migrations'])}[/bold cyan] Migration file(s) in [dim]{migrations_dir}[/dim]\n"
|
|
365
|
+
f"• Generated [bold cyan]{len(result['models'])}[/bold cyan] Eloquent Model(s) in [dim]{models_dir}[/dim]\n"
|
|
366
|
+
f"• Auto-wired BelongsTo, HasMany, and BelongsToMany pivot relationships.",
|
|
367
|
+
border_style="green",
|
|
368
|
+
)
|
|
369
|
+
)
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"""Nexus Optional Tooling Installation Commands.
|
|
2
|
+
|
|
3
|
+
Provides commands to install and publish optional tooling:
|
|
4
|
+
- telescope:install
|
|
5
|
+
- swagger:install
|
|
6
|
+
- db:install
|
|
7
|
+
- db:studio
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import webbrowser
|
|
14
|
+
from typing import TYPE_CHECKING
|
|
15
|
+
|
|
16
|
+
import typer
|
|
17
|
+
from rich.console import Console
|
|
18
|
+
from rich.panel import Panel
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from nexus.foundation.application import Application
|
|
22
|
+
|
|
23
|
+
console = Console()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _update_env_file(app: Application, updates: dict[str, str]) -> None:
|
|
27
|
+
"""Update or append key-value settings in the project .env file."""
|
|
28
|
+
env_path = app.base_path(".env")
|
|
29
|
+
lines: list[str] = []
|
|
30
|
+
if env_path.exists():
|
|
31
|
+
lines = env_path.read_text(encoding="utf-8").splitlines()
|
|
32
|
+
|
|
33
|
+
updated_keys = set()
|
|
34
|
+
new_lines: list[str] = []
|
|
35
|
+
|
|
36
|
+
for line in lines:
|
|
37
|
+
stripped = line.strip()
|
|
38
|
+
replaced = False
|
|
39
|
+
for k, v in updates.items():
|
|
40
|
+
if stripped.startswith((f"{k}=", f"#{k}=", f"# {k}=")):
|
|
41
|
+
new_lines.append(f"{k}={v}")
|
|
42
|
+
updated_keys.add(k)
|
|
43
|
+
os.environ[k] = v
|
|
44
|
+
replaced = True
|
|
45
|
+
break
|
|
46
|
+
if not replaced:
|
|
47
|
+
new_lines.append(line)
|
|
48
|
+
|
|
49
|
+
for k, v in updates.items():
|
|
50
|
+
if k not in updated_keys:
|
|
51
|
+
new_lines.append(f"{k}={v}")
|
|
52
|
+
os.environ[k] = v
|
|
53
|
+
|
|
54
|
+
env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8")
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def register_tool_install_commands(cli: typer.Typer, app: Application) -> None:
|
|
58
|
+
"""Register optional tooling install commands."""
|
|
59
|
+
|
|
60
|
+
@cli.command("telescope:install", help="Install Nexus Telescope observability and enable debugbar")
|
|
61
|
+
def telescope_install() -> None:
|
|
62
|
+
"""Publish config/telescope.py and activate TELESCOPE_ENABLED and TELESCOPE_DEBUGBAR in .env."""
|
|
63
|
+
_update_env_file(
|
|
64
|
+
app,
|
|
65
|
+
{
|
|
66
|
+
"TELESCOPE_ENABLED": "true",
|
|
67
|
+
"TELESCOPE_DEBUGBAR": "true",
|
|
68
|
+
"TELESCOPE_PATH": "/telescope",
|
|
69
|
+
},
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
config_file = app.base_path("config", "telescope.py")
|
|
73
|
+
if not config_file.exists():
|
|
74
|
+
config_file.parent.mkdir(parents=True, exist_ok=True)
|
|
75
|
+
config_file.write_text(
|
|
76
|
+
'''"""Nexus Telescope Configuration."""
|
|
77
|
+
|
|
78
|
+
from nexus.support.env import env
|
|
79
|
+
|
|
80
|
+
CONFIG = {
|
|
81
|
+
"enabled": env("TELESCOPE_ENABLED", True),
|
|
82
|
+
"debugbar": env("TELESCOPE_DEBUGBAR", True),
|
|
83
|
+
"path": env("TELESCOPE_PATH", "/telescope"),
|
|
84
|
+
"max_entries": env("TELESCOPE_MAX_ENTRIES", 100),
|
|
85
|
+
}
|
|
86
|
+
''',
|
|
87
|
+
encoding="utf-8",
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
console.print(
|
|
91
|
+
Panel(
|
|
92
|
+
"[bold green]⚡ Nexus Telescope Installed Successfully![/bold green]\n\n"
|
|
93
|
+
"• [bold cyan]Real-time Dashboard:[/bold cyan] http://localhost:8000/telescope\n"
|
|
94
|
+
"• [bold cyan]In-Browser Debugbar:[/bold cyan] Activated at bottom of HTML pages\n"
|
|
95
|
+
"• [dim]To toggle debugbar, set TELESCOPE_DEBUGBAR=false in .env[/dim]\n"
|
|
96
|
+
"• Published [dim]config/telescope.py[/dim]",
|
|
97
|
+
title="Telescope Observability",
|
|
98
|
+
border_style="green",
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
@cli.command("swagger:install", help="Install OpenAPI Swagger UI documentation tooling")
|
|
103
|
+
def swagger_install() -> None:
|
|
104
|
+
"""Publish config/swagger.py and activate SWAGGER_ENABLED in .env."""
|
|
105
|
+
_update_env_file(
|
|
106
|
+
app,
|
|
107
|
+
{
|
|
108
|
+
"SWAGGER_ENABLED": "true",
|
|
109
|
+
"SWAGGER_PATH": "/api/docs",
|
|
110
|
+
"SWAGGER_SCHEMA_PATH": "/api/openapi.json",
|
|
111
|
+
},
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
config_file = app.base_path("config", "swagger.py")
|
|
115
|
+
if not config_file.exists():
|
|
116
|
+
config_file.parent.mkdir(parents=True, exist_ok=True)
|
|
117
|
+
config_file.write_text(
|
|
118
|
+
'''"""Nexus OpenAPI & Swagger UI Configuration."""
|
|
119
|
+
|
|
120
|
+
from nexus.support.env import env
|
|
121
|
+
|
|
122
|
+
CONFIG = {
|
|
123
|
+
"enabled": env("SWAGGER_ENABLED", True),
|
|
124
|
+
"title": env("SWAGGER_TITLE", "Nexus Application API"),
|
|
125
|
+
"version": env("SWAGGER_VERSION", "1.0.0"),
|
|
126
|
+
"path": env("SWAGGER_PATH", "/api/docs"),
|
|
127
|
+
"schema_path": env("SWAGGER_SCHEMA_PATH", "/api/openapi.json"),
|
|
128
|
+
}
|
|
129
|
+
''',
|
|
130
|
+
encoding="utf-8",
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
console.print(
|
|
134
|
+
Panel(
|
|
135
|
+
"[bold green]⚡ Swagger UI Installed Successfully![/bold green]\n\n"
|
|
136
|
+
"• [bold cyan]Interactive Docs:[/bold cyan] http://localhost:8000/api/docs\n"
|
|
137
|
+
"• [bold cyan]OpenAPI 3.0 Schema:[/bold cyan] http://localhost:8000/api/openapi.json\n"
|
|
138
|
+
"• Published [dim]config/swagger.py[/dim]",
|
|
139
|
+
title="OpenAPI Tooling",
|
|
140
|
+
border_style="green",
|
|
141
|
+
)
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
@cli.command("db:install", help="Install Nexus Database Studio management interface")
|
|
145
|
+
def db_install() -> None:
|
|
146
|
+
"""Publish config/database_studio.py and activate DB_STUDIO_ENABLED in .env."""
|
|
147
|
+
_update_env_file(
|
|
148
|
+
app,
|
|
149
|
+
{
|
|
150
|
+
"DB_STUDIO_ENABLED": "true",
|
|
151
|
+
"DB_STUDIO_PATH": "/db/studio",
|
|
152
|
+
},
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
config_file = app.base_path("config", "database_studio.py")
|
|
156
|
+
if not config_file.exists():
|
|
157
|
+
config_file.parent.mkdir(parents=True, exist_ok=True)
|
|
158
|
+
config_file.write_text(
|
|
159
|
+
'''"""Nexus Database Studio Configuration."""
|
|
160
|
+
|
|
161
|
+
from nexus.support.env import env
|
|
162
|
+
|
|
163
|
+
CONFIG = {
|
|
164
|
+
"enabled": env("DB_STUDIO_ENABLED", True),
|
|
165
|
+
"path": env("DB_STUDIO_PATH", "/db/studio"),
|
|
166
|
+
}
|
|
167
|
+
''',
|
|
168
|
+
encoding="utf-8",
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
console.print(
|
|
172
|
+
Panel(
|
|
173
|
+
"[bold green]⚡ Nexus Database Studio Installed Successfully![/bold green]\n\n"
|
|
174
|
+
"• [bold cyan]Database Management GUI:[/bold cyan] http://localhost:8000/db/studio\n"
|
|
175
|
+
"• [bold cyan]CLI Shortcut:[/bold cyan] Run [white]nexus db:studio[/white] to launch\n"
|
|
176
|
+
"• Features: Table Inspector, Row Pagination, Schema Viewer, Raw SQL Console\n"
|
|
177
|
+
"• Published [dim]config/database_studio.py[/dim]",
|
|
178
|
+
title="Database Studio",
|
|
179
|
+
border_style="green",
|
|
180
|
+
)
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
@cli.command("db:studio", help="Launch Nexus Database Studio in the web browser")
|
|
184
|
+
def db_studio(
|
|
185
|
+
port: int = typer.Option(8000, "--port", "-p", help="Port of the running Nexus server"),
|
|
186
|
+
) -> None:
|
|
187
|
+
"""Open Database Studio in the default web browser."""
|
|
188
|
+
url = f"http://127.0.0.1:{port}/db/studio"
|
|
189
|
+
console.print(f"[bold green]⚡ Opening Nexus Database Studio:[/bold green] [cyan]{url}[/cyan]")
|
|
190
|
+
try:
|
|
191
|
+
webbrowser.open(url)
|
|
192
|
+
except Exception: # noqa: BLE001, S110
|
|
193
|
+
pass
|
|
@@ -18,6 +18,7 @@ from nexus.console.commands import (
|
|
|
18
18
|
register_clear_commands,
|
|
19
19
|
register_config_commands,
|
|
20
20
|
register_database_commands,
|
|
21
|
+
register_db_reverse_command,
|
|
21
22
|
register_key_commands,
|
|
22
23
|
register_make_commands,
|
|
23
24
|
register_new_command,
|
|
@@ -27,6 +28,7 @@ from nexus.console.commands import (
|
|
|
27
28
|
register_serve_command,
|
|
28
29
|
register_starter_commands,
|
|
29
30
|
register_tinker_command,
|
|
31
|
+
register_tool_install_commands,
|
|
30
32
|
)
|
|
31
33
|
|
|
32
34
|
if TYPE_CHECKING:
|
|
@@ -54,6 +56,7 @@ class ConsoleKernel:
|
|
|
54
56
|
"""Register built-in framework commands."""
|
|
55
57
|
register_make_commands(self.cli, self.app)
|
|
56
58
|
register_database_commands(self.cli, self.app)
|
|
59
|
+
register_db_reverse_command(self.cli, self.app)
|
|
57
60
|
register_serve_command(self.cli, self.app)
|
|
58
61
|
register_route_commands(self.cli, self.app)
|
|
59
62
|
register_tinker_command(self.cli, self.app)
|
|
@@ -64,6 +67,7 @@ class ConsoleKernel:
|
|
|
64
67
|
register_schedule_commands(self.cli, self.app)
|
|
65
68
|
register_new_command(self.cli, self.app)
|
|
66
69
|
register_starter_commands(self.cli, self.app)
|
|
70
|
+
register_tool_install_commands(self.cli, self.app)
|
|
67
71
|
|
|
68
72
|
def _load_application_commands(self) -> None:
|
|
69
73
|
"""Load user-defined commands from routes/console.py and app/console/commands/."""
|
|
@@ -29,6 +29,10 @@ class DatabaseManager:
|
|
|
29
29
|
|
|
30
30
|
return self._engines[name]
|
|
31
31
|
|
|
32
|
+
def connection(self, name: str | None = None) -> Engine:
|
|
33
|
+
"""Get or initialize the database engine connection."""
|
|
34
|
+
return self.engine(name)
|
|
35
|
+
|
|
32
36
|
def get_default_connection_name(self) -> str:
|
|
33
37
|
"""Get the default connection identifier from configuration or fallback."""
|
|
34
38
|
if self.container.bound("config"):
|