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

Client should skip columns if value is null #28

Open
javier opened this issue May 14, 2024 · 1 comment
Open

Client should skip columns if value is null #28

javier opened this issue May 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@javier
Copy link
Contributor

javier commented May 14, 2024

When adding columns to the sender, if we pass a null value, as in

sender.table('prices').symbol('instrument', 'EURUSD')
            .floatColumn('bid', null).at(Date.now(), 'ms');

It would be convenient that the column was ignored, rather than raising an error. It would make things easier for programmatic access

@javier javier added the enhancement New feature or request label May 14, 2024
@javier
Copy link
Contributor Author

javier commented May 14, 2024

Current workaround is something like

// start building the sender with the initial required columns
        let builder = sender.table('prices').symbol('instrument', 'EURUSD')
            .floatColumn('bid', 1.0197);

        // conditionally add the ask column
        if (includeAsk) {
            builder = builder.floatColumn('ask', 1.0224);
        }

        // finalize the builder with the timestamp
        await builder.at(Date.now(), 'ms');

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

No branches or pull requests

1 participant