Skip to content

Commit 1d77b17

Browse files
committed
docs: remove deparse docs, update full/ README for PG 18
1 parent 51f8b58 commit 1d77b17

2 files changed

Lines changed: 3 additions & 40 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ npm install @pgsql/enums
102102
- **Just need to parse SQL?** → Use `libpg-query` (lightweight, all PG versions)
103103
- **Need multiple versions at runtime?** → Use `@pgsql/parser` (dynamic version selection)
104104
- **Need TypeScript types?** → Add `@pgsql/types` and/or `@pgsql/enums`
105-
- **Need fingerprint, normalize, or deparse?** → Use `@libpg-query/parser` (PG 17 only)
105+
- **Need fingerprint, normalize, scan, or PL/pgSQL parsing?** → Use `@libpg-query/parser` (PG 18)
106106

107107

108108
## API Documentation

full/README.md

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -95,30 +95,6 @@ import { parsePlPgSQLSync } from '@libpg-query/parser';
9595
const result = parsePlPgSQLSync(functionSql);
9696
```
9797

98-
### `deparse(parseTree: ParseResult): Promise<string>`
99-
100-
Converts a parse tree back to SQL string. Returns a Promise for the SQL string.
101-
102-
```typescript
103-
import { parse, deparse } from '@libpg-query/parser';
104-
105-
const parseTree = await parse('SELECT * FROM users WHERE active = true');
106-
const sql = await deparse(parseTree);
107-
// Returns: string - reconstructed SQL query
108-
```
109-
110-
### `deparseSync(parseTree: ParseResult): string`
111-
112-
Synchronous version that converts a parse tree back to SQL string directly.
113-
114-
```typescript
115-
import { parseSync, deparseSync } from '@libpg-query/parser';
116-
117-
const parseTree = parseSync('SELECT * FROM users WHERE active = true');
118-
const sql = deparseSync(parseTree);
119-
// Returns: string - reconstructed SQL query
120-
```
121-
12298
### `fingerprint(sql: string): Promise<string>`
12399

124100
Generates a unique fingerprint for a SQL query that can be used for query identification and caching. Returns a Promise for a 16-character fingerprint string.
@@ -195,11 +171,10 @@ The library provides both async and sync methods. Async methods handle initializ
195171
Async methods handle initialization automatically and are always safe to use:
196172

197173
```typescript
198-
import { parse, deparse, scan } from '@libpg-query/parser';
174+
import { parse, scan } from '@libpg-query/parser';
199175

200176
// These handle initialization automatically
201177
const result = await parse('SELECT * FROM users');
202-
const sql = await deparse(result);
203178
const tokens = await scan('SELECT * FROM users');
204179
```
205180

@@ -325,19 +300,7 @@ pnpm run test
325300

326301
## Versions
327302

328-
Our latest is built with `17-latest` branch from libpg_query
329-
330-
331-
| PG Major Version | libpg_query | Branch | npm
332-
|--------------------------|-------------|------------------------------------------------------------------------------------------------|---------|
333-
| 17 | 17-latest | [`17-latest`](https://github.com/constructive-io/libpg-query-node/tree/17-latest) | [`libpg-query@17.2.0`](https://www.npmjs.com/package/libpg-query/v/latest)
334-
| 16 | 16-latest | [`16-latest`](https://github.com/constructive-io/libpg-query-node/tree/16-latest) | [`libpg-query@16.2.0`](https://www.npmjs.com/package/libpg-query/v/16.2.0)
335-
| 15 | 15-latest | [`15-latest`](https://github.com/constructive-io/libpg-query-node/tree/15-latest) | [`libpg-query@15.1.0`](https://www.npmjs.com/package/libpg-query/v/15.1.0)
336-
| 14 | 14-latest | [`14-latest`](https://github.com/constructive-io/libpg-query-node/tree/14-latest) | [`libpg-query@14.0.0`](https://www.npmjs.com/package/libpg-query/v/14.0.0)
337-
| 13 | 13-latest | [`13-latest`](https://github.com/constructive-io/libpg-query-node/tree/13-latest) | [`libpg-query@13.3.1`](https://www.npmjs.com/package/libpg-query/v/13.3.1)
338-
| 12 | (n/a) | |
339-
| 11 | (n/a) | |
340-
| 10 | 10-latest | | `@1.3.1` ([tree](https://github.com/constructive-io/pgsql-parser/tree/39b7b1adc8914253226e286a48105785219a81ca)) |
303+
Built with the `18-latest` branch from libpg_query (tag `18.0.0`), based on PostgreSQL 18.
341304

342305

343306
## Troubleshooting

0 commit comments

Comments
 (0)