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

Expose more types outside. #1949

Open
create-new-entity opened this issue Jun 10, 2024 · 0 comments
Open

Expose more types outside. #1949

create-new-entity opened this issue Jun 10, 2024 · 0 comments
Assignees

Comments

@create-new-entity
Copy link
Contributor

Issue
Once we parse the query and get the JSON object, we further manipulate the JSON object to get it into a certain shape. To do that we use smaller helper functions in between. It would be nice if we could define types for this smaller functions.

Since these functions take different parts of the JSON and those parts already have types defined within the library ( for example, CreateConstraintForeign, CreateConstraintCheck and so on ), would it be possible to expose those types so that we can utilize them?

Database Engine
Snowflake

To Reproduce
-the node-sql-parser version: 5.2.0
-the node version: 20.11.1

Expected behavior
Allow import statements for types. For example:

import {  CreateColumnDefinition, CreateConstraintForeign, CreateConstraintDefinition } from 'node-sql-parser'

const extractIsFK = ( alterASTs: Alter[], fkConstraintASTs: CreateConstraintForeign[] ): boolean => {
     // Doing some stuffs here
     return some_boolean_value
}

Example in a forked repo
Please also take a look at this PR in this forked repo.

and thanks a lot for this nice library.

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

No branches or pull requests

2 participants