marcidb-client 0.0.7 → 0.0.9
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
CHANGED
|
@@ -29,25 +29,25 @@ model Post {
|
|
|
29
29
|
2. Generate the client:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
|
|
32
|
+
marcidb generate
|
|
33
33
|
# or with custom paths
|
|
34
|
-
|
|
34
|
+
marcidb generate schema.marci node_modules/.marcidb/client
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
3. Start your MarciDB server and connect:
|
|
38
38
|
|
|
39
39
|
```typescript
|
|
40
|
-
import {
|
|
40
|
+
import { marcidb } from "marcidb-client";
|
|
41
41
|
|
|
42
|
-
const db =
|
|
42
|
+
const db = marcidb("http://localhost:3000");
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## Usage
|
|
46
46
|
|
|
47
47
|
```typescript
|
|
48
|
-
import {
|
|
48
|
+
import { marcidb } from "marcidb-client";
|
|
49
49
|
|
|
50
|
-
const db =
|
|
50
|
+
const db = marcidb("http://localhost:3000");
|
|
51
51
|
|
|
52
52
|
// Find
|
|
53
53
|
const users = await db.user.findMany({
|
|
@@ -79,7 +79,7 @@ await db.user.delete({ id: 1 });
|
|
|
79
79
|
After every change to `schema.marci`, re-run:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
|
|
82
|
+
marcidb generate
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
If types don't update in VSCode, run **TypeScript: Restart TS Server** (`Ctrl+Shift+P`).
|
|
Binary file
|
|
Binary file
|