@tailor-platform/sdk 1.45.1 → 1.45.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.
@@ -57,6 +57,42 @@ body: async (input, { env }) => {
57
57
  };
58
58
  ```
59
59
 
60
+ ### Raw SQL
61
+
62
+ For queries that the Kysely query builder can't express, use the `sql` tag re-exported from `@tailor-platform/sdk/kysely`. Plain value substitutions (`${...}`) are sent as bound parameters, so user-supplied values are parameterized safely. SQL fragments produced by Kysely helpers (for example `sql.raw(...)`, identifiers, refs) are inlined into the generated SQL string by design — do not pass untrusted input through those.
63
+
64
+ ```typescript
65
+ import { sql } from "@tailor-platform/sdk/kysely";
66
+ import { getDB } from "./generated/tailordb";
67
+
68
+ createResolver({
69
+ name: "supplierCountByState",
70
+ operation: "query",
71
+ input: { country: t.string() },
72
+ output: t.object({
73
+ rows: t.array(t.object({ state: t.string(), count: t.int() })),
74
+ }),
75
+ body: async ({ input }) => {
76
+ const db = getDB("tailordb");
77
+ const { rows } = await sql<{ state: string; count: number }>`
78
+ SELECT state, COUNT(*) AS count
79
+ FROM "Supplier"
80
+ WHERE country = ${input.country}
81
+ GROUP BY state
82
+ `.execute(db);
83
+ return { rows };
84
+ },
85
+ });
86
+ ```
87
+
88
+ The same `sql` tag works inside `db.transaction().execute(async (trx) => ...)` by passing `trx` to `.execute()`:
89
+
90
+ ```typescript
91
+ await db.transaction().execute(async (trx) => {
92
+ await sql`UPDATE "Supplier" SET state = ${state} WHERE id = ${id}`.execute(trx);
93
+ });
94
+ ```
95
+
60
96
  ## @tailor-platform/enum-constants
61
97
 
62
98
  Extracts enum constants from TailorDB type definitions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "1.45.1",
3
+ "version": "1.45.2",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -102,23 +102,22 @@
102
102
  "chokidar": "5.0.0",
103
103
  "confbox": "0.2.4",
104
104
  "date-fns": "4.1.0",
105
- "es-toolkit": "1.46.0",
105
+ "es-toolkit": "1.46.1",
106
106
  "find-up-simple": "1.0.1",
107
107
  "globals": "17.5.0",
108
108
  "graphql": "16.13.2",
109
109
  "inflection": "3.0.2",
110
- "kysely": "0.28.16",
110
+ "kysely": "0.28.17",
111
111
  "madge": "8.0.0",
112
112
  "mime-types": "3.0.2",
113
113
  "open": "11.0.0",
114
- "ora": "9.4.0",
115
114
  "oxc-parser": "0.127.0",
116
115
  "p-limit": "7.3.0",
117
116
  "pathe": "2.0.3",
118
117
  "pgsql-ast-parser": "12.0.2",
119
- "pkg-types": "2.3.0",
118
+ "pkg-types": "2.3.1",
120
119
  "politty": "0.4.15",
121
- "rolldown": "1.0.0-rc.17",
120
+ "rolldown": "1.0.0-rc.18",
122
121
  "semver": "7.7.4",
123
122
  "serve": "14.2.6",
124
123
  "sql-highlight": "6.1.0",
@@ -137,18 +136,18 @@
137
136
  "@types/mime-types": "3.0.1",
138
137
  "@types/node": "24.12.2",
139
138
  "@types/semver": "7.7.1",
140
- "@typescript/native-preview": "7.0.0-dev.20260426.1",
139
+ "@typescript/native-preview": "7.0.0-dev.20260503.1",
141
140
  "@vitest/coverage-v8": "4.1.5",
142
- "eslint": "10.2.1",
141
+ "eslint": "10.3.0",
143
142
  "eslint-plugin-jsdoc": "62.9.0",
144
143
  "eslint-plugin-oxlint": "1.61.0",
145
144
  "oxfmt": "0.46.0",
146
145
  "oxlint": "1.61.0",
147
- "oxlint-tsgolint": "0.22.0",
146
+ "oxlint-tsgolint": "0.22.1",
148
147
  "sonda": "0.11.1",
149
148
  "tsdown": "0.21.10",
150
149
  "typescript": "5.9.3",
151
- "typescript-eslint": "8.59.0",
150
+ "typescript-eslint": "8.59.1",
152
151
  "vitest": "4.1.5",
153
152
  "zinfer": "0.1.8"
154
153
  },