You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to put in a vote that says this is a terrible idea. I think a good use case for this library will be making data from an older, legacy database available. Bookrest should definitely not alter the schema of databases in any way.
Specifically excluding rather than altering databases without PKs is a much better idea.
In fact, I think you should add configuration variables that let you either exclude or specifically whitelist tables to expose to the API.
Logic would be:
tables = self.get_tables()
if hasattr(settings, 'BOOKREST_TABLES'):
tables = [table for table in tables if table in settings.BOOKREST_TABLES]
elif hasattr(settings, 'BOOKREST_EXCLUDE'):
tables = [table for table in tables if table not in settings.BOOKREST_EXCLUDE]
tables = [table for table in tables if has_primary_key(table)] # exercise for reader
return [self.get_model(table.name) for table in tables]
The text was updated successfully, but these errors were encountered:
I agree with @JordanReiter completely! The module should not alter the schema in any way.
It would be more ideal to include or exclude certain tables from the API.
I'd like to put in a vote that says this is a terrible idea. I think a good use case for this library will be making data from an older, legacy database available. Bookrest should definitely not alter the schema of databases in any way.
Specifically excluding rather than altering databases without PKs is a much better idea.
In fact, I think you should add configuration variables that let you either exclude or specifically whitelist tables to expose to the API.
Logic would be:
The text was updated successfully, but these errors were encountered: