true-pg 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -8
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# true-pg
|
2
2
|
|
3
|
-
A truthful and complete
|
3
|
+
A truthful and complete[1] TypeScript code generator for PostgreSQL database schemas.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -22,12 +22,12 @@ true-pg [options]
|
|
22
22
|
|
23
23
|
Options:
|
24
24
|
|
25
|
-
-
|
26
|
-
-
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
25
|
+
- `-h, --help` - Show help information
|
26
|
+
- `-c, --config [path]` - Path to config file (JSON)
|
27
|
+
- `-u, --uri [uri]` - Database URI (Postgres only!)
|
28
|
+
- `-o, --out [path]` - Path to output directory (defaults to "models")
|
29
|
+
- `-a, --adapter [adapter]` - Adapter to use (e.g. `kysely`, `zod`). Can be specified multiple times.
|
30
|
+
- `-A, --all-adapters` - Enable all built-in adapters
|
31
31
|
|
32
32
|
You can configure true-pg either through command-line arguments or a config file.
|
33
33
|
|
@@ -120,8 +120,12 @@ The `SchemaGenerator` interface provides methods to customize code generation:
|
|
120
120
|
| `formatSchemaType(type)` | Formats schema type names (user_sessions -> UserSessions) |
|
121
121
|
| `formatType(type)` | Formats type names (pg_catalog.int4 -> number) |
|
122
122
|
| `table(types, table)` | Generates code for tables |
|
123
|
+
| `view(types, view)` | Generates code for views |
|
124
|
+
| `materialisedView(types, view)` | Generates code for materialised views |
|
123
125
|
| `enum(types, en)` | Generates code for enums |
|
124
126
|
| `composite(types, composite)` | Generates code for composite types |
|
127
|
+
| `domain(types, domain)` | Generates code for domains |
|
128
|
+
| `range(types, range)` | Generates code for ranges |
|
125
129
|
| `function(types, func)` | Generates code for functions |
|
126
130
|
| `schemaKindIndex(schema, kind)` | Generates index for a schema kind (models/public/tables/index.ts) |
|
127
131
|
| `schemaIndex(schema)` | Generates index for a schema (models/public/index.ts) |
|
@@ -131,4 +135,4 @@ The `SchemaGenerator` interface provides methods to customize code generation:
|
|
131
135
|
|
132
136
|
[MIT](LICENSE)
|
133
137
|
|
134
|
-
|
138
|
+
[1]: We support codegen for tables, views, materialized views, enums, composite types, domains, ranges, and functions.
|