graphile-cache 1.4.11 → 1.4.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 +42 -42
- 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-cache
|
|
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-cache">
|
|
@@ -67,7 +67,7 @@ if (cached) {
|
|
|
67
67
|
}
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
### Automatic cleanup
|
|
70
|
+
### Automatic cleanup
|
|
71
71
|
|
|
72
72
|
The cleanup happens automatically:
|
|
73
73
|
|
|
@@ -96,13 +96,13 @@ import { postgraphile } from 'postgraphile';
|
|
|
96
96
|
|
|
97
97
|
function getGraphileInstance(database: string, schema: string): GraphileCache {
|
|
98
98
|
const key = `${database}.${schema}`;
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
// Check cache first
|
|
101
101
|
const cached = graphileCache.get(key);
|
|
102
102
|
if (cached) {
|
|
103
103
|
return cached;
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
// Create new instance
|
|
107
107
|
const pgPool = getPgPool({ database });
|
|
108
108
|
const handler = postgraphile(pgPool, schema, {
|
|
@@ -110,13 +110,13 @@ function getGraphileInstance(database: string, schema: string): GraphileCache {
|
|
|
110
110
|
graphiqlRoute: '/graphiql',
|
|
111
111
|
// other options...
|
|
112
112
|
});
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
const entry: GraphileCache = {
|
|
115
115
|
pgPool,
|
|
116
116
|
pgPoolKey: database,
|
|
117
117
|
handler
|
|
118
118
|
};
|
|
119
|
-
|
|
119
|
+
|
|
120
120
|
// Cache it
|
|
121
121
|
graphileCache.set(key, entry);
|
|
122
122
|
return entry;
|
|
@@ -184,71 +184,71 @@ This design ensures:
|
|
|
184
184
|
|
|
185
185
|
## Education and Tutorials
|
|
186
186
|
|
|
187
|
-
1. 🚀 [Quickstart: Getting Up and Running](https://
|
|
187
|
+
1. 🚀 [Quickstart: Getting Up and Running](https://constructive.io/learn/quickstart)
|
|
188
188
|
Get started with modular databases in minutes. Install prerequisites and deploy your first module.
|
|
189
189
|
|
|
190
|
-
2. 📦 [Modular PostgreSQL Development with Database Packages](https://
|
|
190
|
+
2. 📦 [Modular PostgreSQL Development with Database Packages](https://constructive.io/learn/modular-postgres)
|
|
191
191
|
Learn to organize PostgreSQL projects with pgpm workspaces and reusable database modules.
|
|
192
192
|
|
|
193
|
-
3. ✏️ [Authoring Database Changes](https://
|
|
193
|
+
3. ✏️ [Authoring Database Changes](https://constructive.io/learn/authoring-database-changes)
|
|
194
194
|
Master the workflow for adding, organizing, and managing database changes with pgpm.
|
|
195
195
|
|
|
196
|
-
4. 🧪 [End-to-End PostgreSQL Testing with TypeScript](https://
|
|
196
|
+
4. 🧪 [End-to-End PostgreSQL Testing with TypeScript](https://constructive.io/learn/e2e-postgres-testing)
|
|
197
197
|
Master end-to-end PostgreSQL testing with ephemeral databases, RLS testing, and CI/CD automation.
|
|
198
198
|
|
|
199
|
-
5. ⚡ [Supabase Testing](https://
|
|
199
|
+
5. ⚡ [Supabase Testing](https://constructive.io/learn/supabase)
|
|
200
200
|
Use TypeScript-first tools to test Supabase projects with realistic RLS, policies, and auth contexts.
|
|
201
201
|
|
|
202
|
-
6. 💧 [Drizzle ORM Testing](https://
|
|
202
|
+
6. 💧 [Drizzle ORM Testing](https://constructive.io/learn/drizzle-testing)
|
|
203
203
|
Run full-stack tests with Drizzle ORM, including database setup, teardown, and RLS enforcement.
|
|
204
204
|
|
|
205
|
-
7. 🔧 [Troubleshooting](https://
|
|
205
|
+
7. 🔧 [Troubleshooting](https://constructive.io/learn/troubleshooting)
|
|
206
206
|
Common issues and solutions for pgpm, PostgreSQL, and testing.
|
|
207
207
|
|
|
208
|
-
## Related
|
|
208
|
+
## Related Constructive Tooling
|
|
209
209
|
|
|
210
210
|
### 🧪 Testing
|
|
211
211
|
|
|
212
|
-
* [
|
|
213
|
-
* [
|
|
214
|
-
* [
|
|
215
|
-
* [
|
|
212
|
+
* [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.
|
|
213
|
+
* [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.
|
|
214
|
+
* [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.
|
|
215
|
+
* [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.
|
|
216
216
|
|
|
217
217
|
### 🧠 Parsing & AST
|
|
218
218
|
|
|
219
|
-
* [
|
|
220
|
-
* [
|
|
221
|
-
* [
|
|
222
|
-
* [@pgsql/enums](https://
|
|
223
|
-
* [@pgsql/types](https://
|
|
224
|
-
* [@pgsql/utils](https://
|
|
225
|
-
* [
|
|
219
|
+
* [pgsql-parser](https://www.npmjs.com/package/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
|
|
220
|
+
* [libpg-query-node](https://www.npmjs.com/package/libpg-query): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
|
|
221
|
+
* [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.
|
|
222
|
+
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): **🏷️ TypeScript enums** for PostgreSQL AST for safe and ergonomic parsing logic.
|
|
223
|
+
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
|
|
224
|
+
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
|
|
225
|
+
* [pg-ast](https://www.npmjs.com/package/pg-ast): **🔍 Low-level AST tools** and transformations for Postgres query structures.
|
|
226
226
|
|
|
227
227
|
### 🚀 API & Dev Tools
|
|
228
228
|
|
|
229
|
-
* [launchql/server](https://github.com/
|
|
230
|
-
* [launchql/explorer](https://github.com/
|
|
229
|
+
* [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.
|
|
230
|
+
* [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.
|
|
231
231
|
|
|
232
232
|
### 🔁 Streaming & Uploads
|
|
233
233
|
|
|
234
|
-
* [launchql/s3-streamer](https://github.com/
|
|
235
|
-
* [launchql/etag-hash](https://github.com/
|
|
236
|
-
* [launchql/etag-stream](https://github.com/
|
|
237
|
-
* [launchql/uuid-hash](https://github.com/
|
|
238
|
-
* [launchql/uuid-stream](https://github.com/
|
|
239
|
-
* [launchql/upload-names](https://github.com/
|
|
234
|
+
* [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.
|
|
235
|
+
* [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.
|
|
236
|
+
* [launchql/etag-stream](https://github.com/constructive-io/constructive/tree/main/packages/etag-stream): **🔄 ETag computation** via Node stream transformer during upload or transfer.
|
|
237
|
+
* [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.
|
|
238
|
+
* [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.
|
|
239
|
+
* [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.
|
|
240
240
|
|
|
241
241
|
### 🧰 CLI & Codegen
|
|
242
242
|
|
|
243
|
-
* [pgpm](https://github.com/
|
|
244
|
-
* [@launchql/cli](https://github.com/
|
|
245
|
-
* [launchql/launchql-gen](https://github.com/
|
|
246
|
-
* [@launchql/query-builder](https://github.com/
|
|
247
|
-
* [@launchql/query](https://github.com/
|
|
243
|
+
* [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.
|
|
244
|
+
* [@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.
|
|
245
|
+
* [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.
|
|
246
|
+
* [@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.
|
|
247
|
+
* [@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.
|
|
248
248
|
|
|
249
249
|
## Credits
|
|
250
250
|
|
|
251
|
-
🛠 Built by
|
|
251
|
+
🛠 Built by Constructive — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/constructive-io)
|
|
252
252
|
|
|
253
253
|
|
|
254
254
|
## Disclaimer
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-cache",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.13",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "PostGraphile LRU cache with automatic pool cleanup integration",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"module": "esm/index.js",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
|
-
"homepage": "https://github.com/
|
|
9
|
+
"homepage": "https://github.com/constructive-io/constructive",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/
|
|
17
|
+
"url": "https://github.com/constructive-io/constructive"
|
|
18
18
|
},
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/constructive-io/constructive/issues"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"clean": "makage clean",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@launchql/logger": "^1.1.
|
|
32
|
+
"@launchql/logger": "^1.1.13",
|
|
33
33
|
"lru-cache": "^11.1.0",
|
|
34
34
|
"pg": "^8.16.0",
|
|
35
|
-
"pg-cache": "^1.4.
|
|
35
|
+
"pg-cache": "^1.4.9",
|
|
36
36
|
"postgraphile": "^4.14.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"postgresql",
|
|
50
50
|
"launchql"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "5a0d7c7502624bd42a214f983fd7ab957e1fb3e3"
|
|
53
53
|
}
|