-
Notifications
You must be signed in to change notification settings - Fork 9
docs: Add usage examples for Resource class methods #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ethan-Arrowood
left a comment
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 looks good to me. I think the 4.5 page needs fixing. Looks like only partially copied. All the others look good.
docs/reference/resources/index.md
Outdated
| #### Example | ||
|
|
||
| ```js | ||
| const MyTable = tables.table_name; // Same as databases.data.MyTable |
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.
tables === databases.data, but table_name !== MyTable !== Product. Throughout this, I am not sure if we are trying to stick to Product, MyTable, or table_name.
|
|
||
| ### `tables` | ||
|
|
||
| This is an object with all the tables in the default database (the default database is "data"). Each table that has been declared or created will be available as a (standard) property on this object, and the value will be the table class that can be used to interact with that table. The table classes implement the Resource API. |
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.
If we are going to add this, I wonder if it should be at line 58 before we first reference tables.MyTable?
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 just realized we have two "Globals" references in the docs. The top-level page and then this subsection. TBH i don't think we need to tackle reorganization within this pr. Just updating the sections in place with more details is helpful enough and then we'll make larger organization and flow changes later.
Ethan-Arrowood
left a comment
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.
Almost there. after making these edits please copy and paste to the version directories as necessary.
Co-authored-by: Ethan Arrowood <[email protected]>
Co-authored-by: Ethan Arrowood <[email protected]>
Co-authored-by: Ethan Arrowood <[email protected]>
Co-authored-by: Ethan Arrowood <[email protected]>
Co-authored-by: Ethan Arrowood <[email protected]>
Co-authored-by: Ethan Arrowood <[email protected]>
Ethan-Arrowood
left a comment
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.
lgtm
kriszyp
left a comment
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.
These are helpful examples, thank for you putting this together.
Ethan-Arrowood
left a comment
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.
We tested the code and its running as expected. This LGTM ![]()
|
didn't mean to merge without your review @kriszyp ! Miscommunication on my part. If you notice anything else out of place please follow up and we can push a fix immediately. |
|
No problem, glad it is merged, great work! |
Give code example for accessing tables in Harper resources