DASSL / ClassDB

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

Add User view #149

Closed KevinKelly25 closed 6 years ago

KevinKelly25 commented 6 years ago

I created this to show my work so far with the user view. With the exception of Lines 4 to 6, I tested all other statements, which was done in an independent database rather then ClassDB (so qualified object name, classdb. was not used and was added after testing).

I have never isMember before and while I did read how it was used in testHelpers.sql I am unsure If I used the proper syntax.

The push into dev will probably have to wait until other PRs are done. However, in the meantime, I would appreciate it if I can get some feedback.

wildtayne commented 6 years ago

This is a good start. I have a few comments:

KevinKelly25 commented 6 years ago

@srrollo Thank you for the comment.

I know what you mean about the extra commits but I am not completely sure how to stop a pull request from including all the extra info. I will ask in the meeting today.

As for the use of User_t instead of User; I am using User_t because the convention in CS205. This convention is used when you have derived attributes in a table you create a view with the table name and add _t to the table name. This way when User is called it is referring to the view instead of the table which is normally what would be called since it has all the added derived attributes.

For the format concerning CASE I did try to make them look neater but most of the time they ended up getting more messy and harder to read. I would like to know as well if there is a better convention for the format that someone knows.

smurthys commented 6 years ago

It is OK to locally merge another ongoing branch to your own. In fact, It is often required to do this if the functionality we want to provide needs stuff in another branch. However, we should avoid pushing changes from our branch while the other branch is still outstanding.

(git compares files in your branch plus the changes from the other branch with the dev branch. Thus the many files and comments, etc. showing up in this PR.)

That said, just make sure you don't make any changes locally to files from the other branch.

On the changes themselves (echoing some of @srrollo's observations):

(SELECT CASE WHEN ClassDB.IsMember(RoleName , 'classdb_instructor') THEN TRUE ELSE FALSE END)

Is the same as just calling ClassDB.IsMember(RoleName , 'classdb_instructor') because the CASE statement returns TRUE if TRUE and FALSE if FALSE.

I recall you started a gist for this purpose. I recommend you use that and get feedback over there. Or, you could use the Winter2018 repo to cause notifications and get faster responses.

smurthys commented 6 years ago

I propose closing this PR and deleting the branch because the enclosed commits have been invalidated by other PRs since, e.g., #154

KevinKelly25 commented 6 years ago

Closing PR, as discussed in meeting, because enclosed commits have been invalidated by other PRs since creation