You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A refused schema registration is an unhandled rejection that ends ajs project dev, not a failure of the queries on that schema #61
docs/external-mode.md of @antelopejs/rethinkdb says that when registration fails, "every query on it fails with the same message", and its README says schema initialization "refuses" a table that declares a unique index. The module does reject: Schemas.register throws and registerExternal keeps the failure in the schema's gate.
The consumer's new Schema(id, definition) (interface-database dist/schema.js) calls Schemas.register(...) and drops its promise, so the rejection reaches core as Unhandled rejection: Error: Table 'bad.ghost' reads table ghost, which database erp does not have, and ajs project dev exits with code 1 before any query is made. A query can never fail with that message in a running project.
Reproduction: an external instance (mode: "external"), new Schema("bad", { ghost: { fields: { a: "string" }, indexes: {} } }) in a consumer module under ajs project dev. The same happens for a unique secondary index in owned mode, an _id over keys of two types and an unknown field type.
Fix idea: either keep the registration promise on the Schema (so createInstance/queries reject with it, as the docs say) and handle the rejection, or reword the docs to say the project stops with the message. The verification skill of the rethinkdb V5 PR pins the message in the run's logs and the process exit, not a failing query.
Activity
docs(schema): state that a refused registration fails the schema's qu…
fix(schema): keep a refused registration in the schema gate instead o…
Upd4ting commentedon Nov 9, 2026
Fixed by #81 (merged).