drizzle-zero-sqlite 0.5.18 → 0.5.20
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/README.md +7 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,8 @@ Generate a Zero schema from a Drizzle SQLite schema while keeping Drizzle as the
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { drizzleZeroConfig } from 'drizzle-zero-sqlite'
|
|
7
|
-
import { generateDrizzleSchemaFile } from 'on-zero/drizzle'
|
|
8
7
|
|
|
9
|
-
const zeroSchema = drizzleZeroConfig(
|
|
8
|
+
export const zeroSchema = drizzleZeroConfig(
|
|
10
9
|
{ ...schema, relations },
|
|
11
10
|
{
|
|
12
11
|
tables: {
|
|
@@ -15,8 +14,11 @@ const zeroSchema = drizzleZeroConfig(
|
|
|
15
14
|
},
|
|
16
15
|
}
|
|
17
16
|
)
|
|
18
|
-
|
|
19
|
-
const source = generateDrizzleSchemaFile(zeroSchema)
|
|
20
17
|
```
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
`drizzleZeroConfig()` returns a real Zero schema created with
|
|
20
|
+
`@rocicorp/zero`. Pass it anywhere Zero expects your schema.
|
|
21
|
+
|
|
22
|
+
The translator accepts Drizzle `sqliteTable` definitions and beta
|
|
23
|
+
`defineRelations` exports, including `through(...)` relations. It rejects
|
|
24
|
+
PostgreSQL tables so a project cannot silently generate the wrong dialect.
|