vite-plugin-postgres-import 0.3.1 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/parse.js +3 -5
package/README.md CHANGED
@@ -71,7 +71,7 @@ The only 4 sqlc annotations that are available are the following:
71
71
 
72
72
  - `:one` - returns template argument, or the default-parsed ones from the select/returning clause.
73
73
 
74
- ex.: `Query<R = { ... }>(c): Promise<R>`
74
+ ex.: `Query<R extends QueryResultRow = { ... }>(c): Promise<R>`
75
75
 
76
76
  - `:many` - returns template argument as an array, or the default-parsed ones from the select/returning clause.
77
77
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-postgres-import",
3
3
  "description": "Vite plugin for importing SQL files as JS modules with sqlc-style annotations",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "main": "plugin.js",
6
6
  "type": "module",
7
7
  "author": "SirKostya009",
package/parse.js CHANGED
@@ -136,11 +136,9 @@ export function ${module.name}<${module.returnSymbols
136
136
  ? `unknown[]`
137
137
  : `[ ${r?.map(() => `unknown`)?.join(", ") ?? ""} ]`
138
138
  }`
139
- : `R${i + 1}${module.execution[i] === ":one" ? `` : ` extends QueryResultRow`} = {${
140
- r.length > 3 ? "\n\t" : " "
141
- }${r?.map((r) => `${r}: unknown`)?.join(r.length > 3 ? ";\n\t" : "; ") ?? ""}${
142
- r.length > 3 ? "\n" : " "
143
- }}`
139
+ : `R${i + 1} extends QueryResultRow = {${r.length > 3 ? "\n\t" : " "}${
140
+ r?.map((r) => `${r}: unknown`)?.join(r.length > 3 ? ";\n\t" : "; ") ?? ""
141
+ }${r.length > 3 ? "\n" : " "}}`
144
142
  )
145
143
  .join(", ")}>(
146
144
  tx: Pool | ClientBase | Promise<ClientBase>,${keys.length ? `\n\tparams: Record<${keys}, unknown>` : ``}