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

fix: add missing function mappings #945

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

patricebender
Copy link
Member

No description provided.

@BobdenOs
Copy link
Contributor

Tests ?

@patricebender patricebender changed the title fix: add missing date function mapping fix: add missing function mappings Dec 13, 2024
(
(
Copy link
Member Author

Choose a reason for hiding this comment

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

didnt work before, because we already have seconds from the EXTRACT(EPOCH) step, so multiplying by 86400 again drastically inflates the result.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why no just move the multiplication and keep the EXTRACT and replace syntax ? As the new split_part syntax repeats the same string functions over and over again.

@patricebender
Copy link
Member Author

Tests ?

👍

// By splitting the DT and calculating the seconds of the time separate from the day
// it possible to determine the full amount of seconds by adding them together as fractionals and multiplying
// the number of seconds in a day
// As sqlite is most accurate with juliandays it is better to do then then using actual second function
// while the odata specification states that the seconds has to be fractional which only julianday allows
/**
* Generates SQL statement that produces an OData compliant duration string like: P12DT23H59M59.999999999999S
* Generates SQL statement that produces a number for a OData compliant duration string like: P12DT23H59M59.999999999999S
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what happened with this sentence, but it should be something more like:

Suggested change
* Generates SQL statement that produces a number for a OData compliant duration string like: P12DT23H59M59.999999999999S
* Generates a SQL statement that processes an OData compliant duration string: P12DT23H59M59.999999999999S

Copy link
Member Author

Choose a reason for hiding this comment

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

that makes more sense, however why not state what the function returns as well?

test/compliance/functions.test.js Show resolved Hide resolved
(
(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why no just move the multiplication and keep the EXTRACT and replace syntax ? As the new split_part syntax repeats the same string functions over and over again.

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

Successfully merging this pull request may close these issues.

2 participants