supatool 0.1.1 → 0.1.21
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 +23 -2
- package/package.json +1 -1
package/README.md
CHANGED
@@ -29,15 +29,36 @@ supatool crud
|
|
29
29
|
|
30
30
|
3. Subcommands
|
31
31
|
|
32
|
+
For more extensible, execute with subcommands:
|
33
|
+
|
34
|
+
- Show help text for all commands
|
35
|
+
supatool help
|
36
|
+
|
37
|
+
- Destination input and output folder
|
38
|
+
supatool -i path/to/type -o path/to/export
|
39
|
+
|
40
|
+
- For detailed usage,
|
32
41
|
See: [src/bin/helptext.ts](./src/bin/helptext.ts) (for development)
|
33
42
|
or [dist/bin/helptext.js](./dist/bin/helptext.js) (for npm package)
|
34
43
|
|
35
|
-
|
44
|
+
## Note: Supabase Client Requirement
|
45
|
+
|
46
|
+
The generated CRUD code assumes that a Supabase client is defined in `../client.ts`.
|
47
|
+
Example:
|
48
|
+
|
49
|
+
```ts
|
50
|
+
// src/integrations/supabase/client.ts
|
51
|
+
import { createClient } from '@supabase/supabase-js'
|
52
|
+
export const supabase = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_ANON_KEY')
|
53
|
+
```
|
36
54
|
|
37
55
|
## VSCode/Cursor: Run Supabase CLI and supatool together
|
38
56
|
|
39
57
|
You can add a task to `.vscode/tasks.json` to run both commands at once:
|
40
58
|
|
59
|
+
> **Note:**
|
60
|
+
> After installing supatool, please restart VSCode (or your terminal) before using the task, so that the new command is recognized.
|
61
|
+
|
41
62
|
```json
|
42
63
|
{
|
43
64
|
"version": "2.0.0",
|
@@ -52,7 +73,7 @@ You can add a task to `.vscode/tasks.json` to run both commands at once:
|
|
52
73
|
}
|
53
74
|
```
|
54
75
|
|
55
|
-
## Example: How to use generated CRUD code in your
|
76
|
+
## Example: How to use generated CRUD code in your apps
|
56
77
|
|
57
78
|
CRUD utility files for the `apps` table will be generated in `src/integrations/supabase/crud-autogen/` by default.
|
58
79
|
|