@vibeorm/sql 3.0.0 → 4.0.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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Snapshot mutable values while preserving plain-object and array validation evidence.
3
+ * Reusable execution bags pass `isHandle` so authentic SQL handles refuse at every depth.
4
+ */
5
+ export declare function snapshotSqlValue(value: unknown, ancestors?: ReadonlySet<object>, isHandle?: (value: object) => boolean): unknown;
6
+ //# sourceMappingURL=parameter-snapshot.d.ts.map
package/dist/params.d.ts CHANGED
@@ -1,17 +1,16 @@
1
- /**
2
- * Parameter collection during rendering.
3
- *
4
- * The single place placeholder indices are produced — renderers never
5
- * hand-write `$1`/`?`, so numbering and value order can never drift apart.
6
- */
7
1
  import type { SqlDialect } from "./dialect.ts";
8
2
  export declare class ParamCollector {
9
3
  private readonly dialect;
4
+ private reserved;
10
5
  readonly values: unknown[];
11
6
  constructor(dialect: SqlDialect);
12
- /** Register one parameter value; returns its placeholder text. */
7
+ /** @internal Allocate recorded positions without inserting sample values. */
8
+ reserve(): string;
9
+ /** Actual positional slots, including repeats of a named input. */
10
+ count(): number;
11
+ /** Register one value; ordinary and reusable paths share transport spelling. */
13
12
  add(value: unknown): string;
14
- /** Register many values; returns their placeholders in order. */
13
+ /** Register many values in positional order. */
15
14
  addMany(values: readonly unknown[]): string[];
16
15
  }
17
16
  //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1,70 @@
1
+ import type { ResultDecoder, ResultReadDecoder, SqlFragment, SqlInputContract } from "@vibeorm/sql";
2
+ import type { ColumnDefinition, Expression, Expressions } from "./types.ts";
3
+ import type { RenderContext } from "./state.ts";
4
+ export declare function nullableDecoder<T>(decoder: ResultReadDecoder<T>): ResultReadDecoder<T | null>;
5
+ export declare function assertDecoder(decoder: ResultReadDecoder<unknown>): void;
6
+ /** Keep physical native refinements in the central codec implementations. */
7
+ export declare function nativeColumnDefinition(definition: ColumnDefinition<unknown>): ColumnDefinition<unknown>;
8
+ /** Transport conversion belongs only at the final result boundary. */
9
+ export declare function transportProjection(params: {
10
+ context: RenderContext;
11
+ expression: string;
12
+ definition: ColumnDefinition<unknown>;
13
+ }): string;
14
+ /** Write contracts carry encoding identity independently from projection output. */
15
+ export declare function columnInputContract(definition: ColumnDefinition<unknown>): SqlInputContract;
16
+ export declare function bindColumnValue(params: {
17
+ context: RenderContext;
18
+ definition: ColumnDefinition<unknown>;
19
+ value: unknown;
20
+ encoder?: ResultDecoder<unknown>;
21
+ rejectNull?: boolean;
22
+ }): string;
23
+ /** Construct a typed value for the public qb.value contract. */
24
+ export declare function literal<T>(params: {
25
+ value: T;
26
+ decoder: ResultDecoder<T>;
27
+ }): Expression<T>;
28
+ /** Construct an explicit fragment projection for the public qb.raw contract. */
29
+ export declare function rawExpression<T>(params: {
30
+ sql: SqlFragment;
31
+ decoder: ResultReadDecoder<T>;
32
+ references?: readonly Expression<unknown>[];
33
+ }): Expression<T>;
34
+ /** Compare typed operands for equality, preserving SQL NULL propagation. */
35
+ export declare const eq: Expressions["eq"];
36
+ /** Compare typed operands for inequality. */
37
+ export declare const ne: Expressions["ne"];
38
+ /** Compare typed operands using greater-than. */
39
+ export declare const gt: Expressions["gt"];
40
+ /** Compare typed operands using greater-than-or-equal. */
41
+ export declare const gte: Expressions["gte"];
42
+ /** Compare typed operands using less-than. */
43
+ export declare const lt: Expressions["lt"];
44
+ /** Compare typed operands using less-than-or-equal. */
45
+ export declare const lte: Expressions["lte"];
46
+ /** Test SQL NULL without comparing a bound null value. */
47
+ export declare const isNull: Expressions["isNull"];
48
+ /** Test SQL non-nullness without comparing a bound null value. */
49
+ export declare const isNotNull: Expressions["isNotNull"];
50
+ /** Combine predicates with SQL AND; an empty conjunction is true. */
51
+ export declare const and: Expressions["and"];
52
+ /** Combine predicates with SQL OR; an empty disjunction is false. */
53
+ export declare const or: Expressions["or"];
54
+ /** Negate a predicate with SQL's three-valued boolean semantics. */
55
+ export declare const not: Expressions["not"];
56
+ /** Match a literal list; an empty list is false. */
57
+ export declare const inList: Expressions["inList"];
58
+ /** Exclude a literal list; an empty list is true. */
59
+ export declare const notInList: Expressions["notInList"];
60
+ /** Count rows or non-null expression values with exact bigint transport. */
61
+ export declare const count: Expressions["count"];
62
+ /** Minimum of a qualified ordered scalar, nullable for empty input. */
63
+ export declare const min: Expressions["min"];
64
+ /** Maximum of a qualified ordered scalar, nullable for empty input. */
65
+ export declare const max: Expressions["max"];
66
+ /** Sum of a qualified double-precision Float, nullable for empty input. */
67
+ export declare const sum: Expressions["sum"];
68
+ /** Average of a qualified double-precision Float, nullable for empty input. */
69
+ export declare const avg: Expressions["avg"];
70
+ //# sourceMappingURL=expressions.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { QueryBuilder } from "./types.ts";
2
+ /** Opt-in native SQL builder. Core fragments/plans are bare-imported from @vibeorm/sql. */
3
+ export declare const qb: QueryBuilder;
4
+ export { and, avg, count, eq, gt, gte, inList, isNotNull, isNull, lt, lte, max, min, ne, not, notInList, or, sum } from "./expressions.ts";
5
+ export type { ColumnDefinition, ColumnDefinitions, Columns, Expression, Expressions, MutationBuilder, NullableRow, Order, Projection, ProjectionRow, QueryBuilder, Scope, SelectBuilder, Source, Table, WriteValues } from "./types.ts";
6
+ //# sourceMappingURL=index.d.ts.map