-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PHPORM-215 Implement Schema::getColumns and getIndexes #3045
Conversation
@@ -146,6 +151,70 @@ public function getTableListing() | |||
return $collections; | |||
} | |||
|
|||
public function getColumns($table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method could get slow for larger collections, so it may be worth adding a $sample
pipeline stage down the road.
Depending on how much the feature is used, we can also consider expanding its functionality in a separate project to be more similar to Compass' schema analysis feature. For now, the current solution provides a good starting point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should try to replicate what is done by Compass. I added $sample
and $limit
stages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried on atlas sample dataset sample_airbnb.listingsAndReviews
. With $sample
, I get this error:
PlanExecutor error during aggregation :: caused by :: Sort exceeded memory limit of 33554432 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.
It works without it. There might be an optimization on the server for this use-case.
Fix PHPORM-215
This method is used by the command
db:table
:Example of output:
Checklist