You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+213-9Lines changed: 213 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,19 @@ For dynamic SQL, string concatenation can be problematic, and AST trees are the
10
10
11
11
Written entirely in plpgsql and can be installed anywhere, even in managed RDBMS environments that don't support untrusted extensions.
12
12
13
-
## Schemas of interest
13
+
## Areas of interest
14
+
15
+
### schemas
14
16
15
17
-`deparser` contains the deparser [(the `deparse()` function)](packages/ast/deploy/schemas/deparser/procedures/deparse.sql) — where the magic happens ✨
16
18
-`ast` contains [tools for building AST trees](packages/ast/deploy/schemas/ast/procedures/types.sql)
17
19
-`ast_helpers` contains [Helpers for higher level AST trees, like `create_table`](packages/ast/deploy/schemas/ast_helpers/procedures/helpers.sql)
18
20
21
+
### extension
22
+
23
+
While the project uses [sqitch](https://sqitch.org/), we've bundled it into a single file and extension using [launchql/cli](https://github.com/launchql/launchql)
24
+
25
+
- the extension lives in [packages/ast/sql](packages/ast/sql)
19
26
## Usage
20
27
21
28
Use the `deparser.deparse()` function to deparse Postgres AST trees, in SQL:
COMMENT ON CONSTRAINT my_constraint ON my_schema.my_table IS E'@type object\n@props id\n@props url\n@props title\n@props tags\nmy description'
540
+
```
541
+
340
542
## installation
341
543
342
544
If you know how to use extensions, or perhaps even just grab the sql and run with it, you can use the bundled extension here [packages/ast/sql](packages/ast/sql). If you run it manually, you just need to make sure to install the `uuid-ossp` extension.
@@ -435,10 +637,12 @@ Our latest is built with `13-latest` branch from libpg_query
0 commit comments