@simtlix/simfinity-postgres 3.5.1 → 3.5.3
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 +3 -3
- package/package.json +3 -3
- package/src/index.js +1 -1
- package/types/index.d.ts +10 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ All Simfinity packages are released together. Install from npm and keep their ve
|
|
|
6
6
|
|
|
7
7
|
## Runtime
|
|
8
8
|
|
|
9
|
-
Create an instance, register the same GraphQL object
|
|
9
|
+
Create an instance, register the same GraphQL object type definitions used by Simfinity (each instance needs its own type objects), build the schema, and await database initialization before serving operations:
|
|
10
10
|
|
|
11
11
|
```javascript
|
|
12
12
|
import pg from 'pg';
|
|
@@ -31,7 +31,7 @@ import { postgresPlugin } from '@simtlix/simfinity-postgres';
|
|
|
31
31
|
const simfinity = createSQL({ plugin: postgresPlugin({ pool, schema: 'library' }) });
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Install `@simtlix/simfinity-sql@3.5.
|
|
34
|
+
Install `@simtlix/simfinity-sql@3.5.3` as a direct dependency when importing its factory. PostgreSQL 15 or later is the only supported SQL plugin. The [SQL package guide](https://github.com/simtlix/simfinity.js/tree/master/packages/sql) documents relational planning and the versioned plugin contract.
|
|
35
35
|
|
|
36
36
|
Both factories permanently bind one pool and schema. The returned runtime supports registration, generated queries and mutations, middleware and scopes, controllers and validators, custom mutations, state machines, nested relationship writes, embedded reconstruction, and native PostgreSQL model handles. Native handles expose `findById`, `find`, `create`, `update`, and `delete`; they are not Mongoose models. `find(args, { session })` accepts the generated GraphQL list query arguments. Existing `pg.Pool` configuration and `pg.PoolClient` query interfaces remain compatible across both factories.
|
|
37
37
|
|
|
@@ -60,7 +60,7 @@ The module and every `createPostgres` instance expose the shared `auth`, `valida
|
|
|
60
60
|
MCP integration is an independent opt-in and does not add MCP dependencies to PostgreSQL applications:
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
npm install @simtlix/simfinity-mcp@3.5.
|
|
63
|
+
npm install @simtlix/simfinity-mcp@3.5.3 @modelcontextprotocol/sdk@^1.13.0
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
```javascript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simtlix/simfinity-postgres",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.3",
|
|
4
4
|
"description": "PostgreSQL GraphQL runtime and schema generation with foreign keys for Simfinity",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"directory": "packages/postgres"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@simtlix/simfinity-core": "3.5.
|
|
31
|
-
"@simtlix/simfinity-sql": "3.5.
|
|
30
|
+
"@simtlix/simfinity-core": "3.5.3",
|
|
31
|
+
"@simtlix/simfinity-sql": "3.5.3",
|
|
32
32
|
"pg": "^8.16.3"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
package/src/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export {
|
|
|
19
19
|
/** Each instance permanently binds one pool/schema; getModel exposes PostgreSQL native helpers. */
|
|
20
20
|
export const createPostgres = (options) => createSQL({ plugin: postgresPlugin(options) });
|
|
21
21
|
const defaultInstance = createPostgres();
|
|
22
|
-
export const { configureQueryLimits, configure, connect, addNoEndpointType, createSchema, getModel, getType, getInputType, getRegistrations, use, registerMutation, saveObject, preventCreatingCollection, withTransaction } = defaultInstance;
|
|
22
|
+
export const { configureQueryLimits, configureMutationLimits, configure, connect, addNoEndpointType, createSchema, getModel, getType, getInputType, getRegistrations, use, registerMutation, saveObject, preventCreatingCollection, withTransaction } = defaultInstance;
|
|
23
23
|
|
|
24
24
|
/** Preserve the foundation low-level API while allowing initialization of the configured default instance. */
|
|
25
25
|
export const initializeDatabase = (poolOrOptions, description, options) => description
|
package/types/index.d.ts
CHANGED
|
@@ -21,10 +21,15 @@ export type {
|
|
|
21
21
|
FieldValidations,
|
|
22
22
|
FieldValidator,
|
|
23
23
|
MiddlewareContext,
|
|
24
|
+
MutationLimitsOptions,
|
|
24
25
|
PermissionSchema,
|
|
25
26
|
PolicyExpression,
|
|
27
|
+
ScopeFunction,
|
|
28
|
+
ScopeOperation,
|
|
29
|
+
ScopeParams,
|
|
26
30
|
StateMachine,
|
|
27
31
|
TypePermissions,
|
|
32
|
+
TypeScopes,
|
|
28
33
|
} from '@simtlix/simfinity-core';
|
|
29
34
|
|
|
30
35
|
export interface DatabaseColumn {
|
|
@@ -180,3 +185,8 @@ export const withTransaction: PostgresRuntime['withTransaction'];
|
|
|
180
185
|
export function initializeDatabase(options?: InitializationOptions): Promise<InitializationResult>;
|
|
181
186
|
|
|
182
187
|
export const configureQueryLimits: Runtime['configureQueryLimits'];
|
|
188
|
+
/**
|
|
189
|
+
* The same process-wide setter as every runtime's configureMutationLimits. Unknown or misspelled
|
|
190
|
+
* options throw INVALID_MUTATION_LIMITS (400) and keep the current limit.
|
|
191
|
+
*/
|
|
192
|
+
export const configureMutationLimits: Runtime['configureMutationLimits'];
|