Skip to content
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

Support for default values #2952

Closed
fredcarle opened this issue Aug 23, 2024 · 0 comments · Fixed by #2997
Closed

Support for default values #2952

fredcarle opened this issue Aug 23, 2024 · 0 comments · Fixed by #2997
Assignees
Labels
feature New feature or request priority/high
Milestone

Comments

@fredcarle
Copy link
Collaborator

We should add support for default values

Possible directive for the feature:

type User {
  name: String
  active: Bool @default(bool: true)
  employer: String @default(string: "ACME")
  age: Int @default(int: 24)
}
@fredcarle fredcarle added feature New feature or request priority/high labels Aug 23, 2024
@fredcarle fredcarle added this to the DefraDB v0.14 milestone Aug 23, 2024
@nasdf nasdf self-assigned this Sep 6, 2024
@nasdf nasdf closed this as completed in ea3a74f Sep 16, 2024
ChrisBQu pushed a commit to ChrisBQu/defradb that referenced this issue Feb 21, 2025
## Relevant issue(s)

Resolves sourcenetwork#2952

## Description

This PR adds support for default field values using a new `@default`
directive.

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

Added integration tests

Specify the platform(s) on which this was tested:
- MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request priority/high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants