Skip to content

feat: add duration support (inMiliseconds) - #493

Merged
vlidholt merged 2 commits into
serverpod:mainfrom
II11II:support_duration_in_milliseconds
Dec 20, 2022
Merged

vlidholt merged 2 commits into
serverpod:mainfrom
II11II:support_duration_in_milliseconds

Conversation

@II11II

@II11II II11II commented Dec 16, 2022

Copy link
Copy Markdown
Contributor

Replace this paragraph with a description of what this PR is changing or adding, and why.

List which issues are fixed by this PR. You must list at least one issue.

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update cointains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

Breaking changes

If you have done any breaking changes, make sure to outline them here, so that they can be included in the notes for the next release.

@II11II

II11II commented Dec 16, 2022

Copy link
Copy Markdown
Contributor Author

#311
#490

@vlidholt vlidholt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks great!

There were some minor formatting issues that needs to be fixed. Also the duration should be stored as an integer in the database (instead of storing it as a json structure). This may require a change to the serverpod_cli package too.

@II11II

II11II commented Dec 19, 2022 •

Copy link
Copy Markdown
Contributor Author

#493 (comment)
#493 (comment)
To have consistency, there should be added rule which forces to add commas after each parameter,
And Should i leave #493 (comment) as it is, to have more readable codes?

@II11II
II11II requested a review from vlidholt December 19, 2022 12:38
@vlidholt

Copy link
Copy Markdown
Collaborator

@II11II at a first glance this looks great now, but I will look over everything tomorrow! :)

@vlidholt vlidholt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still a few minor issues. Almost there! :)

/// Database AND operator.
Expression operator &(dynamic other) {
assert(other is Expression);
return Expression('($this AND $other)');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I may have been unclear here, sorry for that.

  1. These changes are outside the scope of this pull request. Any major changes in formatting should be a separate request.
  2. Only use a trailing comma in this context if the expression spans multiple lines. Writing it on line if it fits is preferable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, make as few changes as possible in a pull request. Only change things that is relevant to the new feature that you are adding. Making changes like this will make it much harder for others to merge their code if they are working on something similar (e.g. adding support for another built-in Dart type).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any major changes in formatting should be a separate request.

Ok, I may have been unclear here, sorry for that.

  1. These changes are outside the scope of this pull request. Any major changes in formatting should be a separate request.
  2. Only use a trailing comma in this context if the expression spans multiple lines. Writing it on line if it fits is preferable.

Now it's clear 🙂
Ill update mr

if (className == 'double') return 'double precision';
if (className == 'DateTime') return 'timestamp without time zone';
if (className == 'ByteData') return 'bytea';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add in the missing new line again here

@II11II
II11II requested a review from vlidholt December 20, 2022 14:36
@vlidholt
vlidholt merged commit 3f74c75 into serverpod:main Dec 20, 2022
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 20, 2022
@vlidholt

Copy link
Copy Markdown
Collaborator

Well done! Thank you! 🤩

@II11II
II11II deleted the support_duration_in_milliseconds branch December 20, 2022 14:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants