-
Notifications
You must be signed in to change notification settings - Fork 43
Add default values docs #4371
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
Add default values docs #4371
Conversation
-------------- | ||
|
||
*Default values* are assigned to tuple fields automatically if these fields are | ||
skipped during the tuple insert or update. |
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.
insert or update
Maybe, add a link to https://www.tarantool.io/en/doc/latest/concepts/data_model/operations/?
|
||
To change the default values, call ``space_object.format()`` again. | ||
|
||
To use a default value for a field, skip it or assign `nil`: |
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'd place this snippet right after the books:format
definition. And then we can tell about more specific things.
books:format({ | ||
{ name = 'id', type = 'unsigned' }, | ||
{ name = 'isbn', type = 'string' }, | ||
{ name = 'title', type = 'string', default = 'No title specified' }, |
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.
Just an idea: as we talk about default functions here, we can remove the default
parameter for title
to simplify the example a bit.
Co-authored-by: Andrey Aksenov <38073144+andreyaksenov@users.noreply.github.com>
Resolves #3520 #3617
Add default values documentation:
default
anddefault_func
default_values
Deployment: https://docs.d.tarantool.io/en/doc/gh-3520-default-values-funcs/concepts/data_model/value_store/#default-values