bun-types-no-globals 1.2.23-canary.20250926T140613 → 1.2.23-canary.20250927T140547

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.
Files changed (2) hide show
  1. package/lib/sql.d.ts +77 -0
  2. package/package.json +1 -1
package/lib/sql.d.ts CHANGED
@@ -12,6 +12,68 @@ declare module "bun" {
12
12
  release(): void;
13
13
  }
14
14
 
15
+ type ArrayType =
16
+ | "BOOLEAN"
17
+ | "BYTEA"
18
+ | "CHAR"
19
+ | "NAME"
20
+ | "TEXT"
21
+ | "CHAR"
22
+ | "VARCHAR"
23
+ | "SMALLINT"
24
+ | "INT2VECTOR"
25
+ | "INTEGER"
26
+ | "INT"
27
+ | "BIGINT"
28
+ | "REAL"
29
+ | "DOUBLE PRECISION"
30
+ | "NUMERIC"
31
+ | "MONEY"
32
+ | "OID"
33
+ | "TID"
34
+ | "XID"
35
+ | "CID"
36
+ | "JSON"
37
+ | "JSONB"
38
+ | "JSONPATH"
39
+ | "XML"
40
+ | "POINT"
41
+ | "LSEG"
42
+ | "PATH"
43
+ | "BOX"
44
+ | "POLYGON"
45
+ | "LINE"
46
+ | "CIRCLE"
47
+ | "CIDR"
48
+ | "MACADDR"
49
+ | "INET"
50
+ | "MACADDR8"
51
+ | "DATE"
52
+ | "TIME"
53
+ | "TIMESTAMP"
54
+ | "TIMESTAMPTZ"
55
+ | "INTERVAL"
56
+ | "TIMETZ"
57
+ | "BIT"
58
+ | "VARBIT"
59
+ | "ACLITEM"
60
+ | "PG_DATABASE"
61
+ | (string & {});
62
+
63
+ /**
64
+ * Represents a SQL array parameter
65
+ */
66
+ interface SQLArrayParameter {
67
+ /**
68
+ * The serialized values of the array parameter
69
+ */
70
+ serializedValues: string;
71
+ /**
72
+ * The type of the array parameter
73
+ */
74
+ arrayType: ArrayType;
75
+ }
76
+
15
77
  /**
16
78
  * Represents a client within a transaction context Extends SQL with savepoint
17
79
  * functionality
@@ -630,6 +692,21 @@ declare module "bun" {
630
692
  */
631
693
  reserve(): Promise<ReservedSQL>;
632
694
 
695
+ /**
696
+ * Creates a new SQL array parameter
697
+ * @param values - The values to create the array parameter from
698
+ * @param typeNameOrTypeID - The type name or type ID to create the array parameter from, if omitted it will default to JSON
699
+ * @returns A new SQL array parameter
700
+ *
701
+ * @example
702
+ * ```ts
703
+ * const array = sql.array([1, 2, 3], "INT");
704
+ * await sql`CREATE TABLE users_posts (user_id INT, posts_id INT[])`;
705
+ * await sql`INSERT INTO users_posts (user_id, posts_id) VALUES (${user.id}, ${array})`;
706
+ * ```
707
+ */
708
+ array(values: any[], typeNameOrTypeID?: number | ArrayType): SQLArrayParameter;
709
+
633
710
  /**
634
711
  * Begins a new transaction.
635
712
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-types-no-globals",
3
- "version": "1.2.23-canary.20250926T140613",
3
+ "version": "1.2.23-canary.20250927T140547",
4
4
  "main": "./generator/index.ts",
5
5
  "types": "./lib/index.d.ts",
6
6
  "description": "TypeScript type definitions for Bun without global types pollution",