taozhi8833998 / taozhi8833998/node-sql-parser
Expose more types outside.
@taozhi8833998 is already working on this.
Since Jun 10, 2024.
- Dominant language
- PEG.js
- Stars
- 1k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.