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

[Issue][noty-api] Using clientDefault instead of default in create and updated datetime columns of NoteTable #640

Open
iamanbansal opened this issue Apr 1, 2023 · 1 comment

Comments

@iamanbansal
Copy link
Contributor

default() sets the default value at the compile time ( or deploy time I am not sure) which stays the same for every row insertion, whereas
clientDefault{} lamda gets called during row insertion, sets the value at runtime

For reference.
https://stackoverflow.com/questions/58315327/what-different-between-default-and-clientdefault-function-in-exposed

var created = datetime("created").clientDefault { DateTime.now() }
...
var updated = datetime("updated").clientDefault { DateTime.now() }
@PatilShreyas
Copy link
Owner

That's a great finding @iamanbansal. Will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants