yesodweb / yesodweb/persistent
doesTableExist causes problems when there are tables with the same name and different owners (persistent-postgres)
@psibi is already working on this.
Since Jun 15, 2016.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
I have to work with my uni's database where each user has access to his/her own tables only. I run into problem when I wanted to create table with the name someone already used. I am able to create it manually by psql, but specifying entity in persistent causes errors because doesTableExist finds those tables. That function is located in: persistent/persistent-postgresql/Database/Persist/Postgresql.hs
For example there is table:
tablename=my_table, tableowner=user1
I want to define model in yesod:
MyTable and I am user2, which should produce:
tablename=my_table, tableowner=user2.
Now doesTableExist would find my_table created by user1, that I have no access to and which should be ignored.
doesTableExist should use query that check if tableowner="databse user" that I have given in settings file.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.