Skip to content

Feat: check if collection exists in database#102

Merged
kodumbeats merged 5 commits intomainfrom
feat-check-if-collection-exists
Jan 21, 2022
Merged

Feat: check if collection exists in database#102
kodumbeats merged 5 commits intomainfrom
feat-check-if-collection-exists

Conversation

@kodumbeats
Copy link
Copy Markdown
Contributor

Since moving every collection to a single default database, we lose the ability to know if a collection has been properly configured (e.g. does the metadata table exist).

This PR extends Utopia\Database\Database::exists() to optionally accept a collection name and test for its existence.

Notes
I'm not sold on this, but the only other nice name I could come up with was collectionExists() which doesn't fit the pattern. Alternative suggestions welcome.

Testing
Unit tests have been added for both success and failure.

@kodumbeats kodumbeats changed the title Feature: check if collection exists in database Feat: check if collection exists in database Jan 19, 2022
Copy link
Copy Markdown
Member

@eldadfux eldadfux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clean. I think the name is OK unless we think of something better. Left a few comments

Comment thread src/Database/Adapter.php Outdated
Comment thread src/Database/Adapter/MariaDB.php Outdated
@kodumbeats kodumbeats merged commit 2f2527b into main Jan 21, 2022
@abnegate abnegate deleted the feat-check-if-collection-exists branch November 23, 2023 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants