-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Database Creation #135
Database Creation #135
Conversation
- some entities have parents or expose user-ids, without additional information - by resolving these within the "endpoint" (not a real notion enpoint) ``Resolve::class``, the additional information can be easily obtained
- why `HasTitle` trait is not used within `Page::class`
- class for building Notion databases and their properties
PR Summary
|
Hey @farez, just wanted to double check, if this goes into the direction you hoped regarding database creation (example of current possibilities with these new changes): $databaseEntity = Notion::databases()
->build()
->inline() // just don't use, if you want it to be as subpage
->title('Title of Database')
->addTitleProperty() // required (that's why it's an extra function for ease of use)
->addProperty('Description', PropertyBuilder::richText())
->addProperty('Number', PropertyBuilder::number('dollar'))
->addRawProperty('Special Property', [ /* raw for unsupported/future properties */ ])
->createInPage('2c682e7372ec4399be1cc015686c69c6'); |
Hello Johannes!
Ah that looks awesome. Should work well.
An idea: have a shortcut method called addProperties() that takes an array
of property definitions. Saves calling addProperty lots of times.
Thanks man. Look forward to using this.
Farez
…On Fri, 28 Apr 2023, 22:58 JohGuentner, ***@***.***> wrote:
Hey @farez <https://github.com/farez>,
just wanted to double check, if this goes into the direction you hoped
regarding database creation (example of current possibilities with these
new changes):
$databaseEntity = Notion::databases()
->build()
->inline() // just don't use, if you want it to be as subpage
->title('Title of Database')
->addTitleProperty() // required (that's why it's an extra function for ease of use)
->addProperty('Description', PropertyBuilder::richText())
->addProperty('Number', PropertyBuilder::number('dollar'))
->addRawProperty('Special Property', [ /* raw for unsupported/future properties */ ])
->createInPage('2c682e7372ec4399be1cc015686c69c6');
—
Reply to this email directly, view it on GitHub
<#135 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJVUPT2C6OJGD52DV4YBDXDPLHVANCNFSM6AAAAAAXPK57TA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
- fix missing parent type - refactor method names to shorter and (hopefully) more readable - introduce `DatabaseSchemeBuilder::class`, which allows a more eloquent definition of a new database structure (similar to Laravel migrations) - allow to add multiple properties at the same time (bulk) - add all further properties (listed within the Notion API docs)
…de/laravel-notion-api into feature/database-creation
Thank you for your input @farez ! |
- cover, icon and description - polish typing
…de/laravel-notion-api into feature/database-creation
- remove adding query to file-name - instead add short hash of query to file-name - or (if given) allow user to set a specific name for upcoming query - additionally save header, method and payload within the snapshot
- remove adding query to file-name - instead add short hash of query to file-name - or (if given) allow user to set a specific name for upcoming query - additionally save header, method and payload within the snapshot
* @param string $name | ||
* @return DatabaseBuilder | ||
*/ | ||
public function addTitle(string $name = 'Name') |
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.
Missing return type? 🤔
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.
it's right there, isn't it ?
- polish `PestHttpRecorder::class`
- ... rebuild snapshots for comments (due to changed file-naming structure)
- due to changed exception message
Adding multiple ways to create a new database within the Notion API
To keep it a bit more similar to Laravel migrations, it's also possible to do it like this:
To keep things simple, it's also possible to use the
PropertyBuilder::class
.Polish of
PestHttpRecorder::class