edgedb
edgedb copied to clipboard
prohibit mutation of schema::Migration
schema::Migration
should be read-only. Currently it allows DELETE
(and INSERT
seems to be allowed to as long as you can compute the hash, I think). We should prohibit any modifications inside the schema::
namespace with DML.
cc @ambv
Deletion of schema::Migration
is used in single-db tests to nuke the database (added here), we probably want to use the future version of wipe-db for those tests instead.
Hey, would you mind providing some more information on this issue (at a new contributor level of understanding).
Also, could you provide a test case that triggers this behavior?
delete schema::Migration
ought to produce a nice error message. Currently, it succeeds. Fortunately, it never actually deletes anything, because there is an access policy on it that causes objects to not be visible to the delete.
Additionally and closely relatedly, delete schema::Object
(and update, insert) will produce an internal server error, as it compiles into broken SQL for various reasons.
We ought to do a proper error check for all of these "mutating objects in the standard library" cases and produce a proper error message.
edb/edgeql/compiler/stmt.py
is the place where statements get compiled from the AST to our IR, and is where the checks should happen