File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/content/documentation/docs Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import Section from '@mdx/Section.astro';
6
6
import CodeTabs from ' @components/markdown/CodeTabs.astro' ;
7
7
8
8
## Type API
9
-
10
9
To retrieve a type from your table schema for ` select ` and ` insert ` queries, you can make use of our type helpers.
11
10
12
11
<Tabs items = { [" PostgreSQL" ," MySQL" ," SQLite" ]} >
@@ -398,3 +397,21 @@ if (is(value, Column)) {
398
397
// value's type is narrowed to Column
399
398
}
400
399
```
400
+
401
+ ### Mock Driver
402
+ This API is a successor to ` drizzle({} as any) ` undefined API which we've used in tests and rarely by other developers.
403
+
404
+ We decided to build and expose a proper API, every ` drizzle ` driver now has ` drizzle.mock() ` :
405
+ ``` ts
406
+ import { drizzle } from " drizzle-orm/node-postgres" ;
407
+
408
+ const db = drizzle .mock ();
409
+ ```
410
+
411
+ you can provide schema if necessary for types
412
+ ``` ts
413
+ import { drizzle } from " drizzle-orm/node-postgres" ;
414
+ import * as schema from " ./schema"
415
+
416
+ const db = drizzle .mock ({ schema });
417
+ ```
You can’t perform that action at this time.
0 commit comments