DASSL / ClassDB

An open-source system to let students experiment with relational data
https://dassl.github.io/ClassDB/
Other
8 stars 2 forks source link

Code is duplicated in addCatalogMgmt.sql (WE) #110

Closed afig closed 6 years ago

afig commented 7 years ago

Code that replicates Postgres's folding behavior is duplicated in listTables and describe (twice in describe). This same code is also found in foldPgID, however foldPgID cannot be used in these two functions due to foldPgID being located in the classdb schema, which is inaccessible to users who are not Instructors or DBManagers.

smurthys commented 7 years ago

An alternative is to define listTables and describe in the ClassDB schema and giving everyone the right to execute these functions (though they may be executed as ClassDB).

A disadvantage to the proposed alternative is that students new to DBMSs need to schema-qualify when calling these functions (ClassDB.listTables()), but I don't see an issue with that: This function exists so students new to RDBMS don't need to know information schema and that they will type in exactly what is shown in an example.

wildtayne commented 6 years ago

Based on our discussion yesterday, I have pushed a branch, remove-foldpgid-dup, that addresses some of the code duplication in this issue. listTables() now only works in the current user's schema, and the first version of Describe() class ClassDB.foldPgID().

I have not yet touched the override of Describe() that can be supplied a schema parameter, because giving it to ClassDB would allow students to access other schemas. I am wondering if we should remove this version completely, or grant it only to instructors.

I have also created a new wiki page for listing actions the M1->M2 migration script will need to preform. For example, it will need to drop Public.Describe(VARCHAR(63)), since Public.Describe() no longer takes a parameter.