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

sqlite: add aggregate function #56600

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

geeksilva97
Copy link
Contributor

@geeksilva97 geeksilva97 commented Jan 14, 2025

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Jan 14, 2025
Comment on lines 72 to +74
V(ack_string, "ack") \
V(step_string, "step") \
V(start_string, "start") \
Copy link
Member

Choose a reason for hiding this comment

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

These should be ordered alphabetically

Local<Object> options = args[1].As<Object>();
Local<Value> step_v;
if (!options->Get(env->context(), env->step_string()).ToLocal(&step_func)) {
// TODO: throw an error; step is required
Copy link
Member

Choose a reason for hiding this comment

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

If Get returns nothing and this is false, then v8 should already be scheduling an error to be thrown. There shouldn't be a need to throw another error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, great! Thanks for letting me know!

: env_(env), fn_(env->isolate(), fn) {}

static void xStep(sqlite3_context* ctx, int argc, sqlite3_value** argv) {}

Copy link
Contributor

Choose a reason for hiding this comment

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

Style nit: can you remove the extra blank lines.

Comment on lines +701 to +702
// database.aggregate(name, { start, step, inverse, result, directOnly,
// deterministic, varargs })
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// database.aggregate(name, { start, step, inverse, result, directOnly,
// deterministic, varargs })

@cjihrig
Copy link
Contributor

cjihrig commented Jan 20, 2025

Also, tests and docs are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node:sqlite: sqlite module should provide wrapper for sqlite3_create_window_function api
5 participants