Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Sep 9, 2024
1 parent 45c81f6 commit 58d1c11
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7309,6 +7309,8 @@ export type Node =
| { AlterDomainStmt: AlterDomainStmt }
| { AlterEnumStmt: AlterEnumStmt }
| { AlterEventTrigStmt: AlterEventTrigStmt }
| { AlterExtensionContentsStmt: AlterExtensionContentsStmt }
| { AlterExtensionStmt: AlterExtensionStmt }
| { AlterFdwStmt: AlterFdwStmt }
| { AlterForeignServerStmt: AlterForeignServerStmt }
| { AlterFunctionStmt: AlterFunctionStmt }
Expand Down Expand Up @@ -7355,6 +7357,7 @@ export type Node =
| { CreateDomainStmt: CreateDomainStmt }
| { CreateEnumStmt: CreateEnumStmt }
| { CreateEventTrigStmt: CreateEventTrigStmt }
| { CreateExtensionStmt: CreateExtensionStmt }
| { CreateFdwStmt: CreateFdwStmt }
| { CreateForeignServerStmt: CreateForeignServerStmt }
| { CreateForeignTableStmt: CreateForeignTableStmt }
Expand Down
18 changes: 18 additions & 0 deletions node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,15 @@ export class NodePath<TNodeTag extends NodeTag = NodeTag> {
isAlterTableMoveAllStmt(): this is NodePath<"AlterTableMoveAllStmt"> {
return this.tag === "AlterTableMoveAllStmt"
}
isCreateExtensionStmt(): this is NodePath<"CreateExtensionStmt"> {
return this.tag === "CreateExtensionStmt"
}
isAlterExtensionStmt(): this is NodePath<"AlterExtensionStmt"> {
return this.tag === "AlterExtensionStmt"
}
isAlterExtensionContentsStmt(): this is NodePath<"AlterExtensionContentsStmt"> {
return this.tag === "AlterExtensionContentsStmt"
}
isCreateFdwStmt(): this is NodePath<"CreateFdwStmt"> {
return this.tag === "CreateFdwStmt"
}
Expand Down Expand Up @@ -810,6 +819,15 @@ export const NodeTag = {
isAlterTableMoveAllStmt(node: object | undefined): node is { AlterTableMoveAllStmt: import("./ast").AlterTableMoveAllStmt } {
return node != null && isTaggedNode(node, "AlterTableMoveAllStmt")
},
isCreateExtensionStmt(node: object | undefined): node is { CreateExtensionStmt: import("./ast").CreateExtensionStmt } {
return node != null && isTaggedNode(node, "CreateExtensionStmt")
},
isAlterExtensionStmt(node: object | undefined): node is { AlterExtensionStmt: import("./ast").AlterExtensionStmt } {
return node != null && isTaggedNode(node, "AlterExtensionStmt")
},
isAlterExtensionContentsStmt(node: object | undefined): node is { AlterExtensionContentsStmt: import("./ast").AlterExtensionContentsStmt } {
return node != null && isTaggedNode(node, "AlterExtensionContentsStmt")
},
isCreateFdwStmt(node: object | undefined): node is { CreateFdwStmt: import("./ast").CreateFdwStmt } {
return node != null && isTaggedNode(node, "CreateFdwStmt")
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"test": "pnpm -s dlx [email protected]",
"install": "[ ! -d .git ] && prebuild-install --runtime napi || true",
"ci:prebuild": "prebuild --runtime napi --target 8 --strip --verbose",
"prepare": "rimraf lib && tsc -p . && node-gyp rebuild && pnpm -s prepare:clangd",
"prepare": "pnpm -s prepare:js && node-gyp rebuild && pnpm -s prepare:clangd",
"prepare:js": "rimraf lib && tsc -p .",
"prepare:clangd": "[ -d .git ] && cd build && compiledb make -f binding.Makefile -n || true",
"prepare:types": "pnpm -s dlx tsx scripts/inferFieldMetadata.ts && pnpm -s dlx tsx scripts/generateTypes.ts",
"prepare:tests": "pnpm -s dlx tsx scripts/generateTests.ts"
Expand Down
4 changes: 4 additions & 0 deletions scripts/generateTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ async function main() {
}
}

typeAliases.delete("CreateExtensionStmt")
typeAliases.delete("AlterExtensionStmt")
typeAliases.delete("AlterExtensionContentsStmt")

for (const name of typeAliases) {
nodeTypes.delete(name)
expressionTypes.delete(name)
Expand Down

0 comments on commit 58d1c11

Please sign in to comment.