-
Notifications
You must be signed in to change notification settings - Fork 14
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
refactor: standard database functions #985
Conversation
- [] factor out SQLite specific functions from base class - [] align jsdoc with capire - [] `cql-functions` in the db-service becomes `sql-functions` and a new interface `cql-functions` is added containing the set of functions which shall be implemented by the dbs themselves this would enable also overwriting/re-using `cql-functions` for non-sql dbs
db-service/lib/cql-functions.js
Outdated
* @param {string} y right timestamp | ||
* @returns {string} | ||
* Generates SQL statement for the current date | ||
* @param {string} [p] - Optional parameter |
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.
is p
allowed according to ANSI SQL ? My understanding is that p
is only allowed by certain databases.
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.
No, at least not for current_date
(I didn't add this in this PR though),
this and excerpt from ANSI SQL 2003:
<current date value function> ::= CURRENT_DATE
<current time value function> ::=
CURRENT_TIME [ <left paren> <time precision> <right paren> ]
<current local time value function> ::=
LOCALTIME [ <left paren> <time precision> <right paren> ]
<current timestamp value function> ::=
CURRENT_TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
<current local timestamp value function> ::=
LOCALTIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
Looks like the precision is ok for the others. I would then remove it from current_date
would you agree?
HANAService
also requiresdb-service/cql-functions
and then also supportsfloor
,ceiling
,average
…totalseconds
cql-functions
in the db-service becomessql-functions
and a new interfacecql-functions
is added containing the set of functions which shall be implemented by the dbs themselves this would enable also overwriting/re-usingcql-functions
for non-sql dbs