@gallopsystems/agent-skills 1.17.0 → 1.18.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/package.json
CHANGED
|
@@ -20,6 +20,35 @@
|
|
|
20
20
|
)
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
**…but only when the expression references the schema.** The whole payoff of
|
|
24
|
+
dropping raw `sql` is letting Kysely validate column/table names against your
|
|
25
|
+
generated types — so the value is proportional to how many schema identifiers the
|
|
26
|
+
expression names. A `sql` template made only of **bound parameters and constants**
|
|
27
|
+
has nothing to check; converting it is lateral churn, and occasionally worse:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// WORTH CONVERTING - names a column, so eb.ref/eb() validate it exists
|
|
31
|
+
.where(sql`lower(name)`, "=", value)
|
|
32
|
+
.where((eb) => eb(eb.fn<string>("lower", [eb.ref("name")]), "=", value))
|
|
33
|
+
|
|
34
|
+
// WORTH CONVERTING - correlated EXISTS validates table + both column refs
|
|
35
|
+
sql<boolean>`EXISTS (SELECT 1 FROM child WHERE child.parent_id = parent.id)`
|
|
36
|
+
eb.exists(eb.selectFrom("child").select(eb.lit(1).as("one"))
|
|
37
|
+
.whereRef("child.parent_id", "=", "parent.id"))
|
|
38
|
+
|
|
39
|
+
// LEAVE RAW - a bound param + a constant cast: no column, nothing to verify.
|
|
40
|
+
// The "typed" form is also a schema MISMATCH: eb.cast(...) is Expression<Date>,
|
|
41
|
+
// but a DATE column is codegen'd as `string` (with --date-parser string).
|
|
42
|
+
sql`${value}::date` // keep it
|
|
43
|
+
|
|
44
|
+
// LEAVE RAW - bare string/number/bool literals have no schema surface
|
|
45
|
+
sql.lit("Unassigned") // keep it (or eb.lit for number/bool, but no real gain)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Rule of thumb: **convert when the raw SQL names a column or table; leave it when
|
|
49
|
+
it is only parameters and literals.** The latter compiles to identical SQL and the
|
|
50
|
+
"type-safe" rewrite verifies nothing.
|
|
51
|
+
|
|
23
52
|
### 2. Don't Forget .execute()
|
|
24
53
|
|
|
25
54
|
Queries are lazy - they won't run without calling an execute method:
|