@vanit-co/sql-ts 1.1.0 → 1.2.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/CHANGELOG.md +20 -0
- package/README.md +488 -364
- package/dist/generate.d.mts +19 -0
- package/dist/generate.d.ts +19 -0
- package/dist/generate.js +83 -0
- package/dist/generate.js.map +1 -0
- package/dist/generate.mjs +80 -0
- package/dist/generate.mjs.map +1 -0
- package/dist/index.d.mts +54 -18
- package/dist/index.d.ts +54 -18
- package/dist/index.js +44 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ All notable changes to this project are documented here. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.2.0] - 2026-12-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- `updateAs(table, colsVals)`: an `update` whose table carries its alias
|
|
11
|
+
(`update "users" as "u" set ...`), so a `where` built with the `where` tag
|
|
12
|
+
resolves against it. `update` is unchanged.
|
|
13
|
+
- Inferred result rows: a query carries the row its `all(...)`, `pick(...)` and
|
|
14
|
+
`expr(...)` select, merged through `append` and `concat`, and `RowOf<typeof q>`
|
|
15
|
+
reads it for the driver. `Result` is now `Result<R = any>`; `Result` alone is
|
|
16
|
+
the untyped result it always was.
|
|
17
|
+
- `expr<V>()(fragment, name)`: a computed column, rendered `(<fragment>) as "name"`
|
|
18
|
+
and typed `name: V`.
|
|
19
|
+
- `@vanit-co/sql-ts/generate`: `postgresColumns` (the introspection query) and
|
|
20
|
+
`generate(columns, options)`, which writes the type records for `schema<R>()`,
|
|
21
|
+
typed the way node-postgres parses each column by default.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- A fragment interpolated into a tag is spliced in. It used to be bound as one
|
|
25
|
+
parameter holding the whole object.
|
|
26
|
+
|
|
7
27
|
## [1.1.0] - 2026-11-28
|
|
8
28
|
|
|
9
29
|
### Added
|