dsh-plugin-dbgraph-service 0.0.0-stage → 0.1.0
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/lib/assert.d.ts +18 -0
- package/lib/assert.js +21 -0
- package/lib/brand.d.ts +36 -0
- package/lib/brand.js +35 -0
- package/lib/index.d.ts +256 -0
- package/lib/index.js +530 -0
- package/lib/invariant.d.ts +16 -0
- package/lib/invariant.js +22 -0
- package/lib/schema.d.ts +150 -0
- package/lib/schema.js +152 -0
- package/lib/tokenize.d.ts +45 -0
- package/lib/tokenize.js +205 -0
- package/lib/types.d.ts +598 -0
- package/lib/types.js +30 -0
- package/lib/zh-aliases.d.ts +72 -0
- package/lib/zh-aliases.js +246 -0
- package/package.json +62 -3
- package/README.md +0 -3
package/lib/assert.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exhaustiveness guard for a closed union, owned by this package rather than borrowed from the host.
|
|
3
|
+
*
|
|
4
|
+
* The equivalent helper used to live in `@deepseek-ai/dsh-llm`; the 0.2.1 runtime moved it to
|
|
5
|
+
* `@deepseek-ai/dsh-util-values` and stopped re-exporting it from the old location, which turns a
|
|
6
|
+
* static `import { assertNever } from '@deepseek-ai/dsh-llm'` into a load-time failure — the whole
|
|
7
|
+
* consumer plugin vanishes from the host instead of failing at one unreachable branch. Carrying the
|
|
8
|
+
* three lines here keeps every dbgraph package loadable across host versions instead of pinning one.
|
|
9
|
+
* @module dsh-plugin-dbgraph-service/assert
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Assert at compile time that `value` is unreachable, and throw if it ever is reached at runtime.
|
|
13
|
+
* @param value - the value typed `never` by an exhaustive switch or if-chain.
|
|
14
|
+
* @param context - optional name of the union being switched on, for the error message.
|
|
15
|
+
* @returns never — the call always throws.
|
|
16
|
+
*/
|
|
17
|
+
export declare function assertNever(value: never, context?: string): never;
|
|
18
|
+
//# sourceMappingURL=assert.d.ts.map
|
package/lib/assert.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exhaustiveness guard for a closed union, owned by this package rather than borrowed from the host.
|
|
3
|
+
*
|
|
4
|
+
* The equivalent helper used to live in `@deepseek-ai/dsh-llm`; the 0.2.1 runtime moved it to
|
|
5
|
+
* `@deepseek-ai/dsh-util-values` and stopped re-exporting it from the old location, which turns a
|
|
6
|
+
* static `import { assertNever } from '@deepseek-ai/dsh-llm'` into a load-time failure — the whole
|
|
7
|
+
* consumer plugin vanishes from the host instead of failing at one unreachable branch. Carrying the
|
|
8
|
+
* three lines here keeps every dbgraph package loadable across host versions instead of pinning one.
|
|
9
|
+
* @module dsh-plugin-dbgraph-service/assert
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Assert at compile time that `value` is unreachable, and throw if it ever is reached at runtime.
|
|
13
|
+
* @param value - the value typed `never` by an exhaustive switch or if-chain.
|
|
14
|
+
* @param context - optional name of the union being switched on, for the error message.
|
|
15
|
+
* @returns never — the call always throws.
|
|
16
|
+
*/
|
|
17
|
+
export function assertNever(value, context) {
|
|
18
|
+
const rendered = JSON.stringify(value) ?? String(value);
|
|
19
|
+
throw new Error(`unreachable variant${context === undefined ? '' : ` in ${context}`}: ${rendered}`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=assert.js.map
|
package/lib/brand.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dbgraph's owned branded ids. {@link ConnectionId} names one configured database connection; it is
|
|
3
|
+
* the key everything else is scoped by (index directory, credential reference, status entry).
|
|
4
|
+
* @module dsh-plugin-dbgraph-service/brand
|
|
5
|
+
*/
|
|
6
|
+
import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
7
|
+
/**
|
|
8
|
+
* Opaque identity of one configured connection. Chosen by the user (`prod`, `test-qingpei`), used
|
|
9
|
+
* verbatim as a directory name under the index root, so the registry validates it against a
|
|
10
|
+
* restricted alphabet before minting one.
|
|
11
|
+
*/
|
|
12
|
+
export type ConnectionId = Branded<'ConnectionId'>;
|
|
13
|
+
/**
|
|
14
|
+
* Brand a string as a {@link ConnectionId}. No validation — the caller that reads user configuration
|
|
15
|
+
* is what rejects an unusable id (see `isValidConnectionId`).
|
|
16
|
+
* @param id - the connection's stable identifier.
|
|
17
|
+
* @returns the same string, branded.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ConnectionId(id: string): ConnectionId;
|
|
20
|
+
/**
|
|
21
|
+
* Whether a raw string may become a {@link ConnectionId}. Restricted to what is safe as both a
|
|
22
|
+
* directory name and a POSIX-environment-variable fragment, because the credential reference is
|
|
23
|
+
* derived from it: lowercase letters, digits, `-` and `_`, starting with a letter or digit.
|
|
24
|
+
* @param id - candidate identifier.
|
|
25
|
+
* @returns true when the id is usable as a connection identity.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isValidConnectionId(id: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The credential reference a connection's password lives under. The host's credential seam carries
|
|
30
|
+
* POSIX environment-variable names, so this is the derivation every caller must share: consume it
|
|
31
|
+
* through {@link credentialRefName} rather than rebuilding the string.
|
|
32
|
+
* @param id - the connection identity.
|
|
33
|
+
* @returns the environment-variable-style reference name, e.g. `DBGRAPH_PROD_PASSWORD`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function credentialRefName(id: ConnectionId): string;
|
|
36
|
+
//# sourceMappingURL=brand.d.ts.map
|
package/lib/brand.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dbgraph's owned branded ids. {@link ConnectionId} names one configured database connection; it is
|
|
3
|
+
* the key everything else is scoped by (index directory, credential reference, status entry).
|
|
4
|
+
* @module dsh-plugin-dbgraph-service/brand
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Brand a string as a {@link ConnectionId}. No validation — the caller that reads user configuration
|
|
8
|
+
* is what rejects an unusable id (see `isValidConnectionId`).
|
|
9
|
+
* @param id - the connection's stable identifier.
|
|
10
|
+
* @returns the same string, branded.
|
|
11
|
+
*/
|
|
12
|
+
export function ConnectionId(id) {
|
|
13
|
+
return id;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Whether a raw string may become a {@link ConnectionId}. Restricted to what is safe as both a
|
|
17
|
+
* directory name and a POSIX-environment-variable fragment, because the credential reference is
|
|
18
|
+
* derived from it: lowercase letters, digits, `-` and `_`, starting with a letter or digit.
|
|
19
|
+
* @param id - candidate identifier.
|
|
20
|
+
* @returns true when the id is usable as a connection identity.
|
|
21
|
+
*/
|
|
22
|
+
export function isValidConnectionId(id) {
|
|
23
|
+
return /^[a-z0-9][a-z0-9_-]{0,63}$/.test(id);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The credential reference a connection's password lives under. The host's credential seam carries
|
|
27
|
+
* POSIX environment-variable names, so this is the derivation every caller must share: consume it
|
|
28
|
+
* through {@link credentialRefName} rather than rebuilding the string.
|
|
29
|
+
* @param id - the connection identity.
|
|
30
|
+
* @returns the environment-variable-style reference name, e.g. `DBGRAPH_PROD_PASSWORD`.
|
|
31
|
+
*/
|
|
32
|
+
export function credentialRefName(id) {
|
|
33
|
+
return `DBGRAPH_${id.toUpperCase().replace(/-/g, '_')}_PASSWORD`;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=brand.js.map
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service Definition for the database-graph capability seam (`ctx.dbgraph`).
|
|
3
|
+
*
|
|
4
|
+
* Three registries, each with a different arity rule, because they answer different questions:
|
|
5
|
+
*
|
|
6
|
+
* - **dialects** — one per {@link Engine}. A second dialect for the same engine is a configuration
|
|
7
|
+
* error, not a preference, so registration rejects it (`DBGRAPH_CONFLICT`).
|
|
8
|
+
* - **the store** — exactly one. Connections are data (rows in `connections.json`), not plugins, so
|
|
9
|
+
* nothing needs per-connection routing; a second store would only be ambiguous.
|
|
10
|
+
* - **connections** — zero or more, read from configuration on demand. Several connections being
|
|
11
|
+
* live at once is the normal case, which is the one place this seam deliberately differs from
|
|
12
|
+
* `ctx.codegraph`'s "exactly one claimant per root".
|
|
13
|
+
*
|
|
14
|
+
* The seam itself does no network I/O and no SQLite: dialects reach servers, the store reads the
|
|
15
|
+
* index, and {@link Dbgraph.find} is the only method that composes both — resolve offline, then
|
|
16
|
+
* execute once.
|
|
17
|
+
* @module dsh-plugin-dbgraph-service
|
|
18
|
+
*/
|
|
19
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
20
|
+
import { HarnessError } from '@deepseek-ai/dsh-llm';
|
|
21
|
+
import type { ColumnsRequest, ColumnsResult, ConnectionSummary, DatabaseDialect, DbgraphService, DbgraphStore, Engine, FindRequest, FindResult, ImpactRequest, ImpactResult, IndexReport, IndexRequest, ObjectsRequest, ObjectsResult, RefsRequest, RefsResult, SchemaRequest, SchemaResult, SqlRequest, SqlResult, StoredConnection } from './types.ts';
|
|
22
|
+
export { assertNever } from './assert.ts';
|
|
23
|
+
export { ConnectionId, credentialRefName, isValidConnectionId } from './brand.ts';
|
|
24
|
+
export type { ConnectionId as ConnectionIdType } from './brand.ts';
|
|
25
|
+
export { CONNECTIONS_FILE_NAME, DEFAULT_ENUM_SAMPLE_LIMIT, DEFAULT_INDEX_STALE_HOURS, DEFAULT_STATUS_DIGEST_OBJECTS, INDEX_FILE_NAME, INDEX_ROOT_DIRNAME, INDEX_META_KEYS, INDEX_SCHEMA_DDL, INDEX_SCHEMA_VERSION, STATUS_FILE_NAME, } from './schema.ts';
|
|
26
|
+
export type { ConnectionsFile, StatusConnectionEntry, StatusDigestEntry, StatusFile, StoredConnection, } from './schema.ts';
|
|
27
|
+
export { SENSITIVE_CJK_WORDS, SENSITIVE_COLUMN_PATTERNS, SENSITIVE_COLUMN_TOKENS, ZH_ALIASES, isSensitiveColumn, } from './zh-aliases.ts';
|
|
28
|
+
export { searchDocument, searchMatchQuery, tokenizeForSearch } from './tokenize.ts';
|
|
29
|
+
export { ENGINES, OBJECT_KINDS, EDGE_KINDS } from './types.ts';
|
|
30
|
+
export type { AliasGroup, ColumnView, ColumnsRequest, ColumnsResult, ConnectionConfig, ConnectionSummary, DatabaseDialect, DbgraphService, DbgraphStore, DialectInput, DialectProbe, EdgeKind, Engine, ExecuteLimits, FindCandidate, FindRequest, FindResult, FindStatus, ImpactRequest, ImpactResult, IndexLevel, IndexReport, IndexRequest, IndexState, IndexWriterKind, MatchedColumn, MatchSource, ObjectKind, ObjectView, ObjectsRequest, ObjectsResult, PredicatePlan, RawCatalog, RawColumn, RawEdge, RawObject, RefsRequest, RefsResult, RelationView, Resolution, Row, SchemaRequest, SchemaResult, SensitiveMode, SqlRequest, SqlResult, WriteOptions, } from './types.ts';
|
|
31
|
+
declare module '@deepseek-ai/cordis' {
|
|
32
|
+
interface Context {
|
|
33
|
+
dbgraph: Dbgraph;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Structured database-graph failure. Extends {@link HarnessError} with a stable `code` that callers
|
|
38
|
+
* route on instead of parsing `message`:
|
|
39
|
+
*
|
|
40
|
+
* `DBGRAPH_INVALID_PROVIDER`, `DBGRAPH_INVALID_REQUEST`, `DBGRAPH_CONFLICT`, `DBGRAPH_NO_STORE`,
|
|
41
|
+
* `DBGRAPH_NO_DIALECT`, `DBGRAPH_DRIVER_MISSING`, `DBGRAPH_UNKNOWN_CONNECTION`, `DBGRAPH_UNKNOWN_OBJECT`,
|
|
42
|
+
* `DBGRAPH_UNAVAILABLE`, `DBGRAPH_MALFORMED_INDEX`, `DBGRAPH_QUERY_FAILED`, `DBGRAPH_WRITE_FAILED`,
|
|
43
|
+
* `DBGRAPH_READ_ONLY`, `DBGRAPH_ABORTED`.
|
|
44
|
+
*
|
|
45
|
+
* Three of those are worth telling apart at a call site: `UNAVAILABLE` means the thing is not there
|
|
46
|
+
* (no index file, no server), `MALFORMED_INDEX` means it is there and this build cannot read it, and
|
|
47
|
+
* `READ_ONLY` means the request was refused rather than failing.
|
|
48
|
+
*/
|
|
49
|
+
export declare class DbgraphError extends HarnessError {
|
|
50
|
+
}
|
|
51
|
+
/** Default rows returned by a `find` or `sql` call when the caller names no limit. */
|
|
52
|
+
export declare const DEFAULT_MAX_ROWS = 50;
|
|
53
|
+
/** Hard ceiling on rows any one call returns, whatever the caller asks for. */
|
|
54
|
+
export declare const HARD_MAX_ROWS = 500;
|
|
55
|
+
/** Default per-statement timeout, in milliseconds. */
|
|
56
|
+
export declare const DEFAULT_QUERY_TIMEOUT_MS = 10000;
|
|
57
|
+
/** Plugin configuration: only the bounds a deployment may retune. */
|
|
58
|
+
export interface Config {
|
|
59
|
+
/** Hours after which an L2 snapshot counts as stale. */
|
|
60
|
+
indexStaleHours?: number;
|
|
61
|
+
/** Statement timeout in milliseconds. */
|
|
62
|
+
queryTimeoutMs?: number;
|
|
63
|
+
/** Rows returned when a caller names no limit. */
|
|
64
|
+
defaultMaxRows?: number;
|
|
65
|
+
/** Distinct-value sample size requested from a dialect. */
|
|
66
|
+
enumSampleLimit?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Whether `sql` may run a statement that is not a read (default `false`).
|
|
69
|
+
*
|
|
70
|
+
* Deliberately separate from a connection's `sensitiveColumns`: masking decides what a result
|
|
71
|
+
* *shows*, and it must never decide whether a statement is allowed to *write*. Turning masking off
|
|
72
|
+
* for one connection is a routine thing to do; opening every connection to DML is not.
|
|
73
|
+
*/
|
|
74
|
+
allowWrites?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `ctx.dbgraph`. Holds the dialect registry and the single store reservation; every read goes
|
|
78
|
+
* through whatever is registered at call time, so a store that unloads mid-session stops serving
|
|
79
|
+
* without leaving a stale route behind.
|
|
80
|
+
*/
|
|
81
|
+
export declare class Dbgraph extends Service implements DbgraphService {
|
|
82
|
+
private readonly dialects;
|
|
83
|
+
private store;
|
|
84
|
+
private readonly config;
|
|
85
|
+
/**
|
|
86
|
+
* @param ctx - Cordis context.
|
|
87
|
+
* @param config - deployment bounds.
|
|
88
|
+
*/
|
|
89
|
+
constructor(ctx: Context, config?: Config);
|
|
90
|
+
/** Hours after which an L2 snapshot is reported stale. */
|
|
91
|
+
get indexStaleHours(): number;
|
|
92
|
+
/** Rows a call returns when the caller names no limit. */
|
|
93
|
+
get defaultMaxRows(): number;
|
|
94
|
+
/** Statement timeout in milliseconds. */
|
|
95
|
+
get queryTimeoutMs(): number;
|
|
96
|
+
/** Distinct-value sample size requested from a dialect. */
|
|
97
|
+
get enumSampleLimit(): number;
|
|
98
|
+
/**
|
|
99
|
+
* Whether `sql` may run a non-read statement. Off unless the deployment says otherwise.
|
|
100
|
+
* @returns the configured value; `false` when unset.
|
|
101
|
+
*/
|
|
102
|
+
get allowWrites(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* The index root the registered store reads and writes, when one is mounted.
|
|
105
|
+
*
|
|
106
|
+
* The prompt digest and the `backgroundIndex` decision read the sidecar synchronously from this
|
|
107
|
+
* path. Deriving it here from the store — rather than each caller deriving its own from the
|
|
108
|
+
* environment — is what keeps the digest and the index describing the same directory.
|
|
109
|
+
* @returns the absolute root, or `undefined` when no store is registered.
|
|
110
|
+
*/
|
|
111
|
+
get storeRoot(): string | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Register one engine's dialect.
|
|
114
|
+
* @param dialect - the dialect to serve.
|
|
115
|
+
* @returns the disposer that unregisters it.
|
|
116
|
+
*/
|
|
117
|
+
registerDialect(dialect: DatabaseDialect): () => void;
|
|
118
|
+
/**
|
|
119
|
+
* Register the offline index store.
|
|
120
|
+
* @param store - the store to serve every read and write.
|
|
121
|
+
* @returns the disposer that unregisters it.
|
|
122
|
+
*/
|
|
123
|
+
registerStore(store: DbgraphStore): () => void;
|
|
124
|
+
/**
|
|
125
|
+
* Every configured connection with its index state.
|
|
126
|
+
* @returns one entry per connection, secrets omitted.
|
|
127
|
+
*/
|
|
128
|
+
listConnections(): Promise<readonly ConnectionSummary[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Structural overview of one connection, from the index.
|
|
131
|
+
* @param request - the connection to describe.
|
|
132
|
+
* @param signal - aborts the read.
|
|
133
|
+
* @returns the overview.
|
|
134
|
+
*/
|
|
135
|
+
schema(request: SchemaRequest, signal?: AbortSignal): Promise<SchemaResult>;
|
|
136
|
+
/**
|
|
137
|
+
* Ranked object listing for one connection, from the index.
|
|
138
|
+
* @param request - the listing request.
|
|
139
|
+
* @param signal - aborts the read.
|
|
140
|
+
* @returns the listing.
|
|
141
|
+
*/
|
|
142
|
+
objects(request: ObjectsRequest, signal?: AbortSignal): Promise<ObjectsResult>;
|
|
143
|
+
/**
|
|
144
|
+
* One object's columns, from the index.
|
|
145
|
+
* @param request - the columns request.
|
|
146
|
+
* @param signal - aborts the read.
|
|
147
|
+
* @returns the column list.
|
|
148
|
+
*/
|
|
149
|
+
columns(request: ColumnsRequest, signal?: AbortSignal): Promise<ColumnsResult>;
|
|
150
|
+
/**
|
|
151
|
+
* Resolve words to an object and columns offline, then execute one parameterized read.
|
|
152
|
+
*
|
|
153
|
+
* This is the method the plugin exists for: zero round-trips learning the schema, exactly one
|
|
154
|
+
* round-trip fetching the answer.
|
|
155
|
+
* @param request - what the user asked about.
|
|
156
|
+
* @param signal - aborts both the resolution and the execution.
|
|
157
|
+
* @returns the rows, or why there are none.
|
|
158
|
+
*/
|
|
159
|
+
find(request: FindRequest, signal?: AbortSignal): Promise<FindResult>;
|
|
160
|
+
/**
|
|
161
|
+
* Execute one statement against the server, with no semantic resolution.
|
|
162
|
+
* @param request - the statement and its limits.
|
|
163
|
+
* @param signal - aborts the execution.
|
|
164
|
+
* @returns the result set.
|
|
165
|
+
*/
|
|
166
|
+
sql(request: SqlRequest, signal?: AbortSignal): Promise<SqlResult>;
|
|
167
|
+
/**
|
|
168
|
+
* Objects a change to one object reaches, from the index.
|
|
169
|
+
* @param request - the object to trace.
|
|
170
|
+
* @param signal - aborts the read.
|
|
171
|
+
* @returns the affected objects.
|
|
172
|
+
*/
|
|
173
|
+
impact(request: ImpactRequest, signal?: AbortSignal): Promise<ImpactResult>;
|
|
174
|
+
/**
|
|
175
|
+
* Objects referencing one object, from the index.
|
|
176
|
+
* @param request - the object to trace.
|
|
177
|
+
* @param signal - aborts the read.
|
|
178
|
+
* @returns the referencing objects.
|
|
179
|
+
*/
|
|
180
|
+
refs(request: RefsRequest, signal?: AbortSignal): Promise<RefsResult>;
|
|
181
|
+
/**
|
|
182
|
+
* Build or refresh an index. With no `connection`, every configured connection is indexed and the
|
|
183
|
+
* first report is returned; use {@link indexMany} when the caller needs all of them.
|
|
184
|
+
* @param request - which connection and how deep.
|
|
185
|
+
* @param signal - aborts the run.
|
|
186
|
+
* @returns the first connection's report.
|
|
187
|
+
*/
|
|
188
|
+
index(request: IndexRequest, signal?: AbortSignal): Promise<IndexReport>;
|
|
189
|
+
/**
|
|
190
|
+
* Index every target connection in one call.
|
|
191
|
+
* @param request - which connections and how deep.
|
|
192
|
+
* @param signal - aborts the run.
|
|
193
|
+
* @returns one report per connection, in configuration order.
|
|
194
|
+
*/
|
|
195
|
+
indexMany(request: IndexRequest, signal?: AbortSignal): Promise<IndexReport[]>;
|
|
196
|
+
/**
|
|
197
|
+
* Resolve one connection's password through the host credential seam.
|
|
198
|
+
* @param connection - the connection to resolve for.
|
|
199
|
+
* @returns the plaintext password, or undefined when the seam is absent or the ref is unconfigured.
|
|
200
|
+
*/
|
|
201
|
+
passwordOf(connection: StoredConnection): Promise<string | undefined>;
|
|
202
|
+
/**
|
|
203
|
+
* The configured connections, as the store's configuration file lists them.
|
|
204
|
+
* @returns the connection list in configuration order.
|
|
205
|
+
*/
|
|
206
|
+
readConnections(): Promise<readonly StoredConnection[]>;
|
|
207
|
+
private indexOne;
|
|
208
|
+
private dialectInputFor;
|
|
209
|
+
private dialectInput;
|
|
210
|
+
private indexStateOf;
|
|
211
|
+
private describeCredential;
|
|
212
|
+
/**
|
|
213
|
+
* The host's credential seam, when this composition has one. Looked up per call rather than
|
|
214
|
+
* captured, so a profile that mounts it later starts working without a restart.
|
|
215
|
+
* @returns the seam, or undefined.
|
|
216
|
+
*/
|
|
217
|
+
private credentialSeam;
|
|
218
|
+
private requireStore;
|
|
219
|
+
private requireDialect;
|
|
220
|
+
private requireConnection;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Quote an identifier the way an engine expects.
|
|
224
|
+
* @param engine - which dialect's quoting rules to apply.
|
|
225
|
+
* @param name - the identifier.
|
|
226
|
+
* @returns the quoted identifier.
|
|
227
|
+
*/
|
|
228
|
+
export declare function quoteIdentifier(engine: Engine, name: string): string;
|
|
229
|
+
/**
|
|
230
|
+
* Render a fully qualified object name.
|
|
231
|
+
* @param engine - which dialect's quoting rules to apply.
|
|
232
|
+
* @param object - name, possibly schema-qualified.
|
|
233
|
+
* @returns the quoted, dotted name.
|
|
234
|
+
*/
|
|
235
|
+
export declare function qualifiedName(engine: Engine, object: string): string;
|
|
236
|
+
/**
|
|
237
|
+
* Render a statement with its bound values substituted, for display only.
|
|
238
|
+
*
|
|
239
|
+
* The result is never executed: it exists so a model reading the answer can see what condition was
|
|
240
|
+
* applied without guessing. Every value is rendered as a quoted literal.
|
|
241
|
+
* @param sql - the statement with `?` placeholders.
|
|
242
|
+
* @param values - the bound values, in placeholder order.
|
|
243
|
+
* @returns the statement with literals substituted.
|
|
244
|
+
*/
|
|
245
|
+
export declare function renderStatement(sql: string, values: readonly unknown[]): string;
|
|
246
|
+
/**
|
|
247
|
+
* Clamp a caller's row limit into the configured ceiling.
|
|
248
|
+
* @param requested - the caller's value, when one was named.
|
|
249
|
+
* @param fallback - the configured default.
|
|
250
|
+
* @returns a limit between 1 and {@link HARD_MAX_ROWS}.
|
|
251
|
+
*/
|
|
252
|
+
export declare function clampLimit(requested: number | undefined, fallback: number): number;
|
|
253
|
+
/** Re-exported so a dialect package can name the branded id without importing `brand.ts`. */
|
|
254
|
+
export type { Branded } from '@deepseek-ai/dsh-brand';
|
|
255
|
+
export default Dbgraph;
|
|
256
|
+
//# sourceMappingURL=index.d.ts.map
|