@sixb/pg 0.2.0 → 0.2.2
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 +9 -8
- package/dist/agents/computers.d.ts +8 -2
- package/dist/agents/computers.d.ts.map +1 -1
- package/dist/index.js +566 -144
- package/dist/index.js.map +20 -17
- package/dist/migrations.d.ts.map +1 -1
- package/dist/objects/conditional-reader.d.ts +7 -2
- package/dist/objects/conditional-reader.d.ts.map +1 -1
- package/dist/objects/partitions.d.ts.map +1 -1
- package/dist/objects/prepare-queries.d.ts.map +1 -1
- package/dist/objects/query-compiler.d.ts +14 -1
- package/dist/objects/query-compiler.d.ts.map +1 -1
- package/dist/objects/query-indexes.d.ts +13 -1
- package/dist/objects/query-indexes.d.ts.map +1 -1
- package/dist/objects/read-scope.d.ts.map +1 -1
- package/dist/objects/reader.d.ts +14 -1
- package/dist/objects/reader.d.ts.map +1 -1
- package/dist/objects/storage.d.ts +1 -0
- package/dist/objects/storage.d.ts.map +1 -1
- package/dist/objects/visibility-indexes.d.ts +22 -0
- package/dist/objects/visibility-indexes.d.ts.map +1 -0
- package/dist/objects/visibility-statistics.d.ts +26 -0
- package/dist/objects/visibility-statistics.d.ts.map +1 -0
- package/dist/objects/visibility.d.ts +34 -0
- package/dist/objects/visibility.d.ts.map +1 -0
- package/dist/pg-client.d.ts.map +1 -1
- package/dist/pg-pipeline-run-storage.d.ts.map +1 -1
- package/dist/pg-sync-run-storage.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/agents/computers.ts +54 -5
- package/src/migrations/087-agent-computer-background-commands.sql +4 -0
- package/src/migrations/088-web-search-model-kind.sql +12 -0
- package/src/migrations.ts +6 -0
- package/src/objects/conditional-reader.ts +26 -4
- package/src/objects/partitions.ts +17 -4
- package/src/objects/prepare-queries.ts +8 -3
- package/src/objects/query-compiler.ts +64 -23
- package/src/objects/query-indexes.ts +93 -27
- package/src/objects/read-scope.ts +147 -77
- package/src/objects/reader.ts +46 -18
- package/src/objects/storage.ts +4 -0
- package/src/objects/visibility-indexes.ts +222 -0
- package/src/objects/visibility-statistics.ts +73 -0
- package/src/objects/visibility.ts +135 -0
- package/src/ontology-storage/materializations.ts +3 -1
- package/src/pg-client.ts +4 -0
- package/src/pg-pipeline-run-storage.ts +5 -7
- package/src/pg-sync-run-storage.ts +2 -7
package/README.md
CHANGED
|
@@ -124,12 +124,7 @@ const User = defineObjectType({
|
|
|
124
124
|
],
|
|
125
125
|
query: {
|
|
126
126
|
indexes: [
|
|
127
|
-
{ kind: "sort", fields: [{ propertyId: "createdAt",
|
|
128
|
-
{
|
|
129
|
-
kind: "sort",
|
|
130
|
-
fields: [{ propertyId: "createdAt", direction: "desc" }],
|
|
131
|
-
filters: ["status"],
|
|
132
|
-
},
|
|
127
|
+
{ kind: "sort", fields: [{ propertyId: "createdAt" }], filters: ["status"] },
|
|
133
128
|
{ kind: "text", propertyId: "searchText", filters: ["status"] },
|
|
134
129
|
],
|
|
135
130
|
},
|
|
@@ -172,10 +167,14 @@ Custom runtimes can opt into the same lifecycle with:
|
|
|
172
167
|
await migrateStorage(storage, {
|
|
173
168
|
projectId: sixb.id,
|
|
174
169
|
ontology: sixb.definitions.ontology,
|
|
170
|
+
security: sixb.definitions.security,
|
|
175
171
|
})
|
|
176
172
|
```
|
|
177
173
|
|
|
178
|
-
|
|
174
|
+
`security` lets preparation index the roles' view conditions; without it, the indexes an earlier
|
|
175
|
+
preparation built for them stay as they are. A member's ordered page walks a sort index, unless
|
|
176
|
+
the statistics on those conditions list none of the member's keys: such a member sees few objects,
|
|
177
|
+
which their page reads first through the condition's index, then sorts. Passing only `storage` retains schema-only migration. Providers without query preparation,
|
|
179
178
|
including SQLite and in-memory storage, continue normally; explicitly calling
|
|
180
179
|
`prepareObjectQueries` or `db prepare` on them reports the unsupported capability.
|
|
181
180
|
|
|
@@ -213,7 +212,9 @@ application configuration should use ontology declarations.
|
|
|
213
212
|
### Pages, search and totals
|
|
214
213
|
|
|
215
214
|
Use `list({ includeTotal: false })` for independently loaded pages. Existing cursor pagination
|
|
216
|
-
uses ordered index ranges, including deep pages.
|
|
215
|
+
uses ordered index ranges, including deep pages. A one-field sort index serves both directions: a
|
|
216
|
+
descending sort breaks ties in reverse identity order, so its page is the ascending index read
|
|
217
|
+
backwards, in two ranges, values then nulls, since nulls sort last either way. Incoming relationship pages can choose an ordered
|
|
217
218
|
endpoint scan after a bounded fanout probe; aggregates use their own execution plan.
|
|
218
219
|
|
|
219
220
|
Search remains literal, case-insensitive substring search, including `%`, `_` and `\` characters.
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type { AgentComputerSessionRecord, AgentComputerSessionStore, Principal } from "@sixb/core/storage";
|
|
1
|
+
import type { AgentBackgroundCommandRef, AgentComputerSessionRecord, AgentComputerSessionStore, Principal } from "@sixb/core/storage";
|
|
2
2
|
import type { PgStoreClient } from "../transactions";
|
|
3
3
|
export declare class PgAgentComputerSessionStore implements AgentComputerSessionStore {
|
|
4
4
|
private readonly sql;
|
|
5
5
|
constructor(sql: PgStoreClient);
|
|
6
|
-
hold(input: AgentComputerSessionRecord): Promise<void>;
|
|
6
|
+
hold(input: Omit<AgentComputerSessionRecord, "stopRequests">): Promise<void>;
|
|
7
|
+
requestStop(input: {
|
|
8
|
+
readonly projectId: string;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly ownerPrincipal: Principal;
|
|
11
|
+
readonly command: AgentBackgroundCommandRef;
|
|
12
|
+
}): Promise<AgentComputerSessionRecord | null>;
|
|
7
13
|
release(input: {
|
|
8
14
|
readonly projectId: string;
|
|
9
15
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/agents/computers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/agents/computers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,yBAAyB,EAEzB,0B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