Skip to content

Commit 3a2c7f6

Browse files
committed
docs: unknown types
1 parent ac55881 commit 3a2c7f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ const users = db.prepare("SELECT * FROM users").all();
9797
9898
Generates types for the input parameters of a query.
9999
100+
The type of an input parameter is set to `unknown` and for named
101+
parameters you can replace that `unknown` with a more specific type.
102+
100103
```ts
101104
// Bad
102105
const user = db.prepare("SELECT * FROM users WHERE id = :id").get({ id: 1 });
@@ -111,6 +114,9 @@ const user = db
111114
112115
Generates types for the result of a query.
113116
117+
If the type of a result column can't be determined then it will be typed
118+
as `unknown` which you can replace with a more specific type.
119+
114120
```ts
115121
// Bad
116122
const user = db.prepare("SELECT * FROM users").all();

0 commit comments

Comments
 (0)