Console: no in-process command dispatch, so a tenant cannot be migrated or seeded on its own connection
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with src/db/commands.rs around migrator and on_database, then review laravel-rust-database/src/db/seeders.rs and docs/console.md to understand the public command and database APIs. Decide which proposed API path fits the framework and how it should support tenant migrations and seeding. Done means application code can run the framework's migration or seeder work on a named connection without reimplementing its bookkeeping.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What I'm building
A database-per-tenant application. Each tenant's connection is registered at runtime:
db::manager().add_connection("ws4", with_database(template, "ws4"))?;
db::manager().using_connection("ws4", future).await
That part works well — the scoped switch is exactly what a tenant needs.
What works
The built-in commands already take a connection name: migrate --database=ws4, migrate:fresh --database=ws4, migrate:status --database=ws4 (laravel-rust/src/db/commands.rs:189, :283).
What's missing
An application command cannot reuse any of that for a tenant.
-
No in-process command dispatch. There is no
Artisan::call()equivalent — noConsole::call, and no mention of one indocs/console.md— so aworkspaces:migratecommand cannot invokemigrate --database=ws4. -
The per-connection runner is crate-private.
fn migrator(manager, database, migrations)(src/db/commands.rs:507) andpub(in crate::db) async fn on_database(..)(src/db/commands.rs:522) — the function that makes--databasethe default while migrations and seeders run — are unreachable from an application.Migratoritself is public (laravel-rust-database/src/db/migrations.rs:170), its construction and bookkeeping are not. -
Seeding is default-connection only.
laravel_rust_database::db::seeders::run(..)(laravel-rust-database/src/db/seeders.rs:181) takes no connection and runs "in one transaction on the default connection". There is no standalone seed command either — seeding is reached only throughmigrate --seed, which is inside the private path above.
Why it matters
Provisioning a tenant becomes a reimplementation: a hand-written migrator loop and its migrations bookkeeping, plus a hand-written seeder runner, instead of the framework's own. On a multi-tenant host that is the core operation — workspaces:migrate, workspaces:seed, workspaces:run <command> all need "run this on that connection", and none of them can be written against today's public API.
What would fix it
Any one of these is sufficient:
Console::call("migrate", ["--database", "ws4"])— Laravel'sArtisan::call, which makes the other two unnecessary;- or
pubonmigrator(..)andon_database(..), so an application can compose the existing runner; - or a
--databaseoption on a standalonedb:seedcommand.
Reproduction
Register a second connection at runtime (db::manager().add_connection("ws4", ..)), then try to run the framework's migrations or seeders against it from application code. The CLI does it (migrate --database=ws4); there is no public API entry point to do the same from a command or a test.
(I'm on laravel-rust 0.1.4, Rust 2024, MySQL.)
- Lingua principale
- Rust
- Stelle
- 847
- Fork
- 174
- Merge medio
- 5h 40m
- PR unite (30g)
- 167
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di laravel/rust-framework
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
laravel/rust-framework#864 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
laravel/rust-framework#876 ·
I maintainer di solito rispondono entro 1 giorno
-
Case-sensitive contains, starts_with and ends_with that match % and _ literally on every databaseAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
laravel/rust-framework#874 ·
I maintainer di solito rispondono entro 1 giorno
-
Unicode case-insensitive like and contains on SQLite (or a hook to register SQLite functions)Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
laravel/rust-framework#873 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
laravel/rust-framework#872 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di laravel/rust-framework
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
neuralmagic/crucible#579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
eclipse-score/kyron#249 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
seanmonstar/reqwest#3157 ·
I maintainer di solito rispondono entro 2 giorni