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

Add Database interface to type definitions #1865

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Conversation

rendall
Copy link
Contributor

@rendall rendall commented Jan 26, 2024

This fixes issue #1180 and adds the property Database to the types/alasql.d.ts file.

The Getting Started section has this code:

    var mybase = new alasql.Database();
    mybase.exec('CREATE TABLE one (two INT)');

However, when using TypeScript, this causes a type error such as:

src/lib/utils.ts:239:25 - error TS2551: Property 'Database' does not exist on type 'AlaSQL'. Did you mean 'databases'?

239   const db = new alasql.Database();
                            ~~~~~~~~

The cause is that [types/alasql.d.ts] has no Database in its type definitions. This PR adds that type definition.

@mathiasrw mathiasrw merged commit d78fb1b into AlaSQL:develop Jan 26, 2024
10 checks passed
@mathiasrw
Copy link
Member

Thank you!

Released as part of v4.2.6

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