@simtlix/simfinity-postgres 3.5.2 → 3.5.5

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 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 types used by Simfinity, build the schema, and await database initialization before serving operations:
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.2` 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.
34
+ Install `@simtlix/simfinity-sql@3.5.5` 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
 
@@ -53,14 +53,14 @@ const schema = createSchema();
53
53
  await initializeDatabase({ mode: 'validate' });
54
54
  ```
55
55
 
56
- Transactions use one borrowed `pg` client and repeatable-read isolation. A supplied Simfinity PostgreSQL session joins the active transaction. Serialization failures and deadlocks are retried up to five times; mutation input is reset for each attempt. Unknown commit outcomes are not replayed. The caller owns the pool lifecycle.
56
+ Transactions use one borrowed `pg` client and repeatable-read isolation. A supplied Simfinity PostgreSQL session joins the active transaction. Serialization failures and deadlocks are retried up to five times, each after a short random delay that starts once the client is released; mutation input is reset for each attempt. Unknown commit outcomes are not replayed. The caller owns the pool lifecycle.
57
57
 
58
58
  The module and every `createPostgres` instance expose the shared `auth`, `validators`, `scalars`, and `plugins` helpers. These are the same helper objects exported by the MongoDB package, so rules, scalar identities, and errors can be shared safely between backends.
59
59
 
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.2 @modelcontextprotocol/sdk@^1.13.0
63
+ npm install @simtlix/simfinity-mcp@3.5.5 @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.2",
3
+ "version": "3.5.5",
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.2",
31
- "@simtlix/simfinity-sql": "3.5.2",
30
+ "@simtlix/simfinity-core": "3.5.5",
31
+ "@simtlix/simfinity-sql": "3.5.5",
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'];