From 744fb685a7bbc41fd17cd2335f4fb863138ba67d Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Fri, 5 Jun 2026 15:40:44 -0400 Subject: [PATCH] rename package to @clickhouse/parser --- README.md | 12 ++++++------ package-lock.json | 4 ++-- package.json | 4 ++-- src/find-nodes.ts | 2 +- src/guards.ts | 2 +- src/transform-nodes.ts | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 67a4c08e5..80e6f7fa1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# clickhouse-node-parser +# @clickhouse/parser A TypeScript parser for ClickHouse SQL. Parses ClickHouse SQL into a typed AST, with support for formatting back to SQL. @@ -7,7 +7,7 @@ A TypeScript parser for ClickHouse SQL. Parses ClickHouse SQL into a typed AST, ## Installation ```bash -npm install clickhouse-node-parser +npm install @clickhouse/parser ``` ## Usage @@ -15,7 +15,7 @@ npm install clickhouse-node-parser ### Parsing SQL to AST ```typescript -import { parse } from 'clickhouse-node-parser'; +import { parse } from '@clickhouse/parser'; const ast = parse('SELECT id, name FROM users WHERE active = 1 ORDER BY name'); ``` @@ -58,7 +58,7 @@ Each node has a `kind` discriminator field. See [ast.ts](src/ast.ts) for all nod ### Formatting AST back to SQL ```typescript -import { parse, format } from 'clickhouse-node-parser'; +import { parse, format } from '@clickhouse/parser'; const ast = parse('SELECT id, name FROM users WHERE active = 1 ORDER BY name'); const sql = format(ast); @@ -80,7 +80,7 @@ ORDER BY name ASC; ### EXPLAIN output ```typescript -import { parse, formatExplain } from 'clickhouse-node-parser'; +import { parse, formatExplain } from '@clickhouse/parser'; const ast = parse('SELECT a + b FROM t WHERE x = 1'); const explain = formatExplain(ast); @@ -112,7 +112,7 @@ SelectWithUnionQuery (children 1) When parsing fails, `parse()` throws a `ParseError` with structured information about where and why the parse failed. ```typescript -import { parse, ParseError } from 'clickhouse-node-parser'; +import { parse, ParseError } from '@clickhouse/parser'; try { parse('SELECT ???'); diff --git a/package-lock.json b/package-lock.json index 7c2402f4e..1ff4f086d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "clickhouse-node-parser", + "name": "@clickhouse/parser", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "clickhouse-node-parser", + "name": "@clickhouse/parser", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index bfb19c44b..c733113e8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "clickhouse-node-parser", + "name": "@clickhouse/parser", "version": "0.1.0", "description": "A TypeScript parser for ClickHouse SQL", "main": "dist/index.js", @@ -61,4 +61,4 @@ "dependencies": { "zod": "^4.3.6" } -} +} \ No newline at end of file diff --git a/src/find-nodes.ts b/src/find-nodes.ts index b98c704b5..3508536ca 100644 --- a/src/find-nodes.ts +++ b/src/find-nodes.ts @@ -6,7 +6,7 @@ import type { Statement, ASTNodeKind, ASTNodeKindMap } from './ast'; * * @example * ```ts - * import { parse, findNodes } from 'clickhouse-node-parser'; + * import { parse, findNodes } from '@clickhouse/parser'; * * const ast = parse('SELECT * FROM t WHERE id = {id:UInt64}'); * diff --git a/src/guards.ts b/src/guards.ts index 04d60202a..d29ace874 100644 --- a/src/guards.ts +++ b/src/guards.ts @@ -6,7 +6,7 @@ import type { ASTNode, ASTNodeKind, ASTNodeKindMap } from './ast'; * * @example * ```ts - * import { isNodeKind } from 'clickhouse-node-parser'; + * import { isNodeKind } from '@clickhouse/parser'; * * const node: ASTNode = ...; * if (isNodeKind(node, 'literal')) { diff --git a/src/transform-nodes.ts b/src/transform-nodes.ts index aff18e435..977a8b9da 100644 --- a/src/transform-nodes.ts +++ b/src/transform-nodes.ts @@ -121,7 +121,7 @@ export interface NodePositionMap { * * @example * ```ts - * import { parse, transformNodes } from 'clickhouse-node-parser'; + * import { parse, transformNodes } from '@clickhouse/parser'; * * const ast = parse('SELECT * FROM t WHERE id = {id:UInt64}'); *