graphile-meta-schema 0.2.11 → 0.2.13
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/LICENSE +1 -1
- package/README.md +68 -48
- package/package.json +7 -7
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2025 Dan Lynch <pyramation@gmail.com>
|
|
4
|
-
Copyright (c) 2025
|
|
4
|
+
Copyright (c) 2025 Constructive <developers@constructive.io>
|
|
5
5
|
Copyright (c) 2020-present, Interweb, Inc.
|
|
6
6
|
|
|
7
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# graphile-meta-schema
|
|
2
2
|
|
|
3
3
|
<p align="center" width="100%">
|
|
4
|
-
<img height="250" src="https://raw.githubusercontent.com/
|
|
4
|
+
<img height="250" src="https://raw.githubusercontent.com/constructive-io/constructive/refs/heads/main/assets/outline-logo.svg" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center" width="100%">
|
|
8
|
-
<a href="https://github.com/
|
|
9
|
-
<img height="20" src="https://github.com/
|
|
8
|
+
<a href="https://github.com/constructive-io/constructive/actions/workflows/run-tests.yaml">
|
|
9
|
+
<img height="20" src="https://github.com/constructive-io/constructive/actions/workflows/run-tests.yaml/badge.svg" />
|
|
10
10
|
</a>
|
|
11
|
-
<a href="https://github.com/
|
|
11
|
+
<a href="https://github.com/constructive-io/constructive/blob/main/LICENSE">
|
|
12
12
|
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/>
|
|
13
13
|
</a>
|
|
14
14
|
<a href="https://www.npmjs.com/package/graphile-meta-schema">
|
|
@@ -16,13 +16,41 @@
|
|
|
16
16
|
</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
**`graphile-meta-schema`** exposes a `_meta` GraphQL schema so you can introspect tables, fields, and constraints directly from PostGraphile.
|
|
20
|
+
|
|
21
|
+
## 🚀 Installation
|
|
20
22
|
|
|
21
23
|
```sh
|
|
22
24
|
pnpm add graphile-meta-schema
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
##
|
|
27
|
+
## ✨ Features
|
|
28
|
+
|
|
29
|
+
- GraphQL meta endpoint for table/field/constraint details
|
|
30
|
+
- Works alongside your existing PostGraphile schemas
|
|
31
|
+
- Ships with fixtures to explore constraint metadata
|
|
32
|
+
|
|
33
|
+
## 📦 Usage
|
|
34
|
+
|
|
35
|
+
Register the plugin with PostGraphile (CLI or library):
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import express from 'express';
|
|
39
|
+
import { postgraphile } from 'postgraphile';
|
|
40
|
+
import PgMetaschemaPlugin from 'graphile-meta-schema';
|
|
41
|
+
|
|
42
|
+
const app = express();
|
|
43
|
+
|
|
44
|
+
app.use(
|
|
45
|
+
postgraphile(process.env.DATABASE_URL, ['app_public'], {
|
|
46
|
+
appendPlugins: [PgMetaschemaPlugin]
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The plugin adds a `_meta` query root alongside your existing schemas. Use it to inspect fields, constraints, relations, and generated inflection.
|
|
52
|
+
|
|
53
|
+
### Example Query
|
|
26
54
|
|
|
27
55
|
```gql
|
|
28
56
|
query MetaQuery {
|
|
@@ -88,90 +116,82 @@ query MetaQuery {
|
|
|
88
116
|
}
|
|
89
117
|
```
|
|
90
118
|
|
|
91
|
-
## Testing
|
|
119
|
+
## 🧪 Testing
|
|
92
120
|
|
|
93
121
|
```sh
|
|
94
122
|
# requires a local Postgres with PostGIS available (defaults to postgres/password@localhost:5432)
|
|
95
123
|
pnpm --filter graphile-meta-schema test
|
|
96
124
|
```
|
|
97
125
|
|
|
98
|
-
If you want to explore the fixtures manually:
|
|
99
|
-
|
|
100
|
-
```sh
|
|
101
|
-
createdb metaschema_example
|
|
102
|
-
psql metaschema_example < sql/test.sql
|
|
103
|
-
psql metaschema_example < sql/types.sql
|
|
104
|
-
```
|
|
105
|
-
|
|
106
126
|
---
|
|
107
127
|
|
|
108
128
|
## Education and Tutorials
|
|
109
129
|
|
|
110
|
-
1. 🚀 [Quickstart: Getting Up and Running](https://
|
|
130
|
+
1. 🚀 [Quickstart: Getting Up and Running](https://constructive.io/learn/quickstart)
|
|
111
131
|
Get started with modular databases in minutes. Install prerequisites and deploy your first module.
|
|
112
132
|
|
|
113
|
-
2. 📦 [Modular PostgreSQL Development with Database Packages](https://
|
|
133
|
+
2. 📦 [Modular PostgreSQL Development with Database Packages](https://constructive.io/learn/modular-postgres)
|
|
114
134
|
Learn to organize PostgreSQL projects with pgpm workspaces and reusable database modules.
|
|
115
135
|
|
|
116
|
-
3. ✏️ [Authoring Database Changes](https://
|
|
136
|
+
3. ✏️ [Authoring Database Changes](https://constructive.io/learn/authoring-database-changes)
|
|
117
137
|
Master the workflow for adding, organizing, and managing database changes with pgpm.
|
|
118
138
|
|
|
119
|
-
4. 🧪 [End-to-End PostgreSQL Testing with TypeScript](https://
|
|
139
|
+
4. 🧪 [End-to-End PostgreSQL Testing with TypeScript](https://constructive.io/learn/e2e-postgres-testing)
|
|
120
140
|
Master end-to-end PostgreSQL testing with ephemeral databases, RLS testing, and CI/CD automation.
|
|
121
141
|
|
|
122
|
-
5. ⚡ [Supabase Testing](https://
|
|
142
|
+
5. ⚡ [Supabase Testing](https://constructive.io/learn/supabase)
|
|
123
143
|
Use TypeScript-first tools to test Supabase projects with realistic RLS, policies, and auth contexts.
|
|
124
144
|
|
|
125
|
-
6. 💧 [Drizzle ORM Testing](https://
|
|
145
|
+
6. 💧 [Drizzle ORM Testing](https://constructive.io/learn/drizzle-testing)
|
|
126
146
|
Run full-stack tests with Drizzle ORM, including database setup, teardown, and RLS enforcement.
|
|
127
147
|
|
|
128
|
-
7. 🔧 [Troubleshooting](https://
|
|
148
|
+
7. 🔧 [Troubleshooting](https://constructive.io/learn/troubleshooting)
|
|
129
149
|
Common issues and solutions for pgpm, PostgreSQL, and testing.
|
|
130
150
|
|
|
131
|
-
## Related
|
|
151
|
+
## Related Constructive Tooling
|
|
132
152
|
|
|
133
153
|
### 🧪 Testing
|
|
134
154
|
|
|
135
|
-
* [
|
|
136
|
-
* [
|
|
137
|
-
* [
|
|
138
|
-
* [
|
|
155
|
+
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/packages/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
|
|
156
|
+
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/packages/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
|
|
157
|
+
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/packages/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
|
|
158
|
+
* [pg-query-context](https://github.com/constructive-io/constructive/tree/main/packages/pg-query-context): **🔒 Session context injection** to add session-local context (e.g., `SET LOCAL`) into queries—ideal for setting `role`, `jwt.claims`, and other session settings.
|
|
139
159
|
|
|
140
160
|
### 🧠 Parsing & AST
|
|
141
161
|
|
|
142
|
-
* [
|
|
143
|
-
* [
|
|
144
|
-
* [
|
|
145
|
-
* [@pgsql/enums](https://
|
|
146
|
-
* [@pgsql/types](https://
|
|
147
|
-
* [@pgsql/utils](https://
|
|
148
|
-
* [
|
|
162
|
+
* [pgsql-parser](https://www.npmjs.com/package/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
|
|
163
|
+
* [libpg-query-node](https://www.npmjs.com/package/libpg-query): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
|
|
164
|
+
* [pg-proto-parser](https://www.npmjs.com/package/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
|
|
165
|
+
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): **🏷️ TypeScript enums** for PostgreSQL AST for safe and ergonomic parsing logic.
|
|
166
|
+
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
|
|
167
|
+
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
|
|
168
|
+
* [pg-ast](https://www.npmjs.com/package/pg-ast): **🔍 Low-level AST tools** and transformations for Postgres query structures.
|
|
149
169
|
|
|
150
170
|
### 🚀 API & Dev Tools
|
|
151
171
|
|
|
152
|
-
* [launchql/server](https://github.com/
|
|
153
|
-
* [launchql/explorer](https://github.com/
|
|
172
|
+
* [launchql/server](https://github.com/constructive-io/constructive/tree/main/packages/server): **⚡ Express-based API server** powered by PostGraphile to expose a secure, scalable GraphQL API over your Postgres database.
|
|
173
|
+
* [launchql/explorer](https://github.com/constructive-io/constructive/tree/main/packages/explorer): **🔎 Visual API explorer** with GraphiQL for browsing across all databases and schemas—useful for debugging, documentation, and API prototyping.
|
|
154
174
|
|
|
155
175
|
### 🔁 Streaming & Uploads
|
|
156
176
|
|
|
157
|
-
* [launchql/s3-streamer](https://github.com/
|
|
158
|
-
* [launchql/etag-hash](https://github.com/
|
|
159
|
-
* [launchql/etag-stream](https://github.com/
|
|
160
|
-
* [launchql/uuid-hash](https://github.com/
|
|
161
|
-
* [launchql/uuid-stream](https://github.com/
|
|
162
|
-
* [launchql/upload-names](https://github.com/
|
|
177
|
+
* [launchql/s3-streamer](https://github.com/constructive-io/constructive/tree/main/packages/s3-streamer): **📤 Direct S3 streaming** for large files with support for metadata injection and content validation.
|
|
178
|
+
* [launchql/etag-hash](https://github.com/constructive-io/constructive/tree/main/packages/etag-hash): **🏷️ S3-compatible ETags** created by streaming and hashing file uploads in chunks.
|
|
179
|
+
* [launchql/etag-stream](https://github.com/constructive-io/constructive/tree/main/packages/etag-stream): **🔄 ETag computation** via Node stream transformer during upload or transfer.
|
|
180
|
+
* [launchql/uuid-hash](https://github.com/constructive-io/constructive/tree/main/packages/uuid-hash): **🆔 Deterministic UUIDs** generated from hashed content, great for deduplication and asset referencing.
|
|
181
|
+
* [launchql/uuid-stream](https://github.com/constructive-io/constructive/tree/main/packages/uuid-stream): **🌊 Streaming UUID generation** based on piped file content—ideal for upload pipelines.
|
|
182
|
+
* [launchql/upload-names](https://github.com/constructive-io/constructive/tree/main/packages/upload-names): **📂 Collision-resistant filenames** utility for structured and unique file names for uploads.
|
|
163
183
|
|
|
164
184
|
### 🧰 CLI & Codegen
|
|
165
185
|
|
|
166
|
-
* [pgpm](https://github.com/
|
|
167
|
-
* [@launchql/cli](https://github.com/
|
|
168
|
-
* [launchql/launchql-gen](https://github.com/
|
|
169
|
-
* [@launchql/query-builder](https://github.com/
|
|
170
|
-
* [@launchql/query](https://github.com/
|
|
186
|
+
* [pgpm](https://github.com/constructive-io/constructive/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
|
|
187
|
+
* [@launchql/cli](https://github.com/constructive-io/constructive/tree/main/packages/cli): **🖥️ Command-line toolkit** for managing LaunchQL projects—supports database scaffolding, migrations, seeding, code generation, and automation.
|
|
188
|
+
* [launchql/launchql-gen](https://github.com/constructive-io/constructive/tree/main/packages/launchql-gen): **✨ Auto-generated GraphQL** mutations and queries dynamically built from introspected schema data.
|
|
189
|
+
* [@launchql/query-builder](https://github.com/constructive-io/constructive/tree/main/packages/query-builder): **🏗️ SQL constructor** providing a robust TypeScript-based query builder for dynamic generation of `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and stored procedure calls—supports advanced SQL features like `JOIN`, `GROUP BY`, and schema-qualified queries.
|
|
190
|
+
* [@launchql/query](https://github.com/constructive-io/constructive/tree/main/packages/query): **🧩 Fluent GraphQL builder** for PostGraphile schemas. ⚡ Schema-aware via introspection, 🧩 composable and ergonomic for building deeply nested queries.
|
|
171
191
|
|
|
172
192
|
## Credits
|
|
173
193
|
|
|
174
|
-
🛠 Built by
|
|
194
|
+
🛠 Built by Constructive — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/constructive-io)
|
|
175
195
|
|
|
176
196
|
|
|
177
197
|
## Disclaimer
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-meta-schema",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "graphile meta schema",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
|
-
"homepage": "https://github.com/
|
|
6
|
+
"homepage": "https://github.com/constructive-io/constructive",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"module": "esm/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/
|
|
27
|
+
"url": "https://github.com/constructive-io/constructive"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"postgraphile",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"launchql"
|
|
37
37
|
],
|
|
38
38
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/
|
|
39
|
+
"url": "https://github.com/constructive-io/constructive/issues"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@graphile-contrib/pg-many-to-many": "^1.0.0",
|
|
43
|
-
"graphile-test": "^2.8.
|
|
43
|
+
"graphile-test": "^2.8.12",
|
|
44
44
|
"graphql-tag": "2.12.6",
|
|
45
45
|
"makage": "^0.1.8",
|
|
46
|
-
"pgsql-test": "^2.14.
|
|
46
|
+
"pgsql-test": "^2.14.15"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"graphile-build": "^4.14.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"graphile-utils": "^4.14.1",
|
|
52
52
|
"graphql": "15.10.1"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "5a0d7c7502624bd42a214f983fd7ab957e1fb3e3"
|
|
55
55
|
}
|