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

Type of params should be iterable not Record #2026

Open
peterbe opened this issue Jan 7, 2025 · 0 comments
Open

Type of params should be iterable not Record #2026

peterbe opened this issue Jan 7, 2025 · 0 comments

Comments

@peterbe
Copy link

peterbe commented Jan 7, 2025

The second argument to alasql in TypeScript used to be any, now it's Record<string, unknown>
6b3e3cb#diff-aad35d480e29819a59beed0bf21ae5a553a730703a60d5b95513ba140757eb21R158 was committed about 3 weeks ago.

My application actually works but now it's failing the TypeScript checks.

The README as this example:

var data = [ {a: 1, b: 10}, {a: 2, b: 20}, {a: 1, b: 30} ];

var res = alasql('SELECT a, SUM(b) AS b FROM ? GROUP BY a',[data]);

This will fail in TypeScript now because [ {a: 1, b: 10}, {a: 2, b: 20}, {a: 1, b: 30} ] is not Record<string, unknown>. It's an Array<Record<string, unknown>>

I noticed this failure in an open project I have that failed CI when upgrading from 4.5.2 to 4.6.1.
peterbe/docsql#568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants