Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ba68151 to
d856797
Compare
cevheri
left a comment
There was a problem hiding this comment.
Thanks for this. The PostgreSQL half is right: I ran all three buttons against a live PostgreSQL 17 with tables in app and in a dotted odd.schema, and both now succeed where they answered relation "public.Mytable" does not exist. It also merges cleanly with main and the full suite passes.
Three providers need a fix before I merge:
- MongoDB:
assertContainerIsBoundcompares withconfig.database, but the row sendsgetDatabaseName(). On a connection-string connection every per-collection button now fails withbound to the database "". Compare withgetDatabaseName(). - Couchbase: the Tables row carries the bucket in
schemaName, not a scope, so Analyze buildstravel.travel.travel. - Oracle: with an owner, the index list comes from
ALL_INDEXES, butALTER INDEX "X" REBUILDis unqualified and rebuilds in the connected user's schema. Qualify it with the owner.
The #772 acceptance also asked for per-provider tests (non-default container, bare target, a name needing quoting) and the docs/providers/ maintenance sections, and only PostgreSQL has them so far. A test that the route and the hook pass container through is missing too. Those tests would have caught all three issues above.
…et (libredb#772) Clicking Vacuum, Analyze or Reindex on a table outside the public schema answered `relation "public.Mytable" does not exist`, because the row already rendered `schemaName` beside the table and the call dropped it, so the provider fell back to `public`. `runMaintenance` now takes the container as a third argument, and the two call sites pass `table.schemaName`. PostgreSQL, SQL Server, DuckDB, MySQL, ClickHouse and Oracle qualify with it (Oracle switching to owner-aware catalog reads), and the engines whose operation cannot name a container say so instead of pretending the target qualified: SQLite, libSQL and MongoDB ignore it with a comment, Couchbase scopes the keyspace, Trino refuses. Docs in providers/postgres.md and DATABASE_PROVIDERS.md carry the new signature. Three provider tests pin the qualification, including a container that itself contains a dot, which the old split-on-name reading could not survive.
…er-provider tests and docs it owed (libredb#772) MongoDB's refuse-other-database check compared config.database, which a connection-string connection never sets - so it refused the very database the provider is bound to, and every per-collection button answered 'bound to the database ""'. It compares getDatabaseName() now. Couchbase's Tables row is the bucket-level one, and reading its bucket back as a scope built travel.travel.travel, no keyspace at all. A bucket container is placed at the default collection, the same placement every bucket-level catalog row gets; any other container is the scope outright. Oracle read the index list from ALL_INDEXES when an owner arrived, but the rebuild was unqualified - ALTER INDEX "X" REBUILD acts on the CONNECTED schema, which is not where the list came from. The rebuild names the owner. Tests: container arms for MSSQL, MySQL, DuckDB, ClickHouse, SQLite, libSQL and Trino beside the three fixed providers, plus the route and hook pass-through tests the review asked for. Docs: the container's meaning is stated in every touched provider section.
d856797 to
afdb791
Compare
|
All three fixed in MongoDB now compares Couchbase places a bucket container at the default collection. That row is the only Tables row this provider has ( Oracle qualifies the rebuild. The list came from Tests. The per-provider arms are in: MSSQL, MySQL, DuckDB and ClickHouse get container, bare and quoting arms each, and SQLite, libSQL and Trino get one pinning that the container is ignored with the reason. The route arm asserts the container reaches Docs. Every touched provider section now states what the container means for that engine, in Verified on the touched files under bun 1.4.2 (the CI pin): 12 spec files, 1921 tests, all passing; typecheck, format, lint, One note on scope: the earlier push of this branch was rebased onto current |
What
Clicking Analyze, Vacuum or Reindex on the monitoring page answered
for every table outside the
publicschema. The row already renderedschemaNamebeside the table name, and the call dropped it, so PostgreSQL's qualifier fell back topublic.Closes #772.
How
runMaintenancetakes the container as a third argument, and the two call sites pass theschemaNametheir row already holds.escapeIdentifierrebuildIndexestakes the ownerkillis untouched everywhere, because its "target" is a PID rather than a table.Two of these were found while building rather than reported: Oracle's index rebuild answered ORA-01418 for a table name, and ClickHouse's parts listing read the wrong database, both because the schema never arrived.
Not a behaviour change for existing callers
The container is optional and the old readings stay when it is absent: a bare name still defaults to
public, andschema.tableis still quoted per-part.Tests
Three provider tests pin the qualifier at the layer that builds the SQL:
Checking the container by splitting the name cannot work, since a schema may contain a dot, and that case is the one the third test above separates.
Verified by reverting the fix in
postgres.tsand watching exactly the two container tests fail while the no-container one stays green, then mutating the qualifier to re-split the container on its dots and watching only the dot case fail.Existing assertions in
TablesTab.test.tsxandOperationsTab.test.tsxare updated to the three-argument call. 501 tests pass across the four touched files,tsc --noEmitis clean, andbun run lintreports 0 errors. The 13 pre-existing failures elsewhere inbun run testare identical on a clean base.