roto-rooter 0.5.1 → 0.7.0
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 +28 -1
- package/dist/cli.js +155 -108
- package/dist/index.js +108 -108
- package/dist/parsers/action-parser.d.ts +0 -12
- package/dist/parsers/action-parser.d.ts.map +1 -1
- package/dist/sql/drizzle-operations.d.ts +21 -0
- package/dist/sql/drizzle-operations.d.ts.map +1 -0
- package/dist/sql/drizzle.d.ts +16 -0
- package/dist/sql/drizzle.d.ts.map +1 -0
- package/dist/sql/types.d.ts +50 -0
- package/dist/sql/types.d.ts.map +1 -0
- package/dist/sql-extractor.d.ts +35 -0
- package/dist/sql-extractor.d.ts.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,15 @@ rr --check drizzle
|
|
|
43
43
|
|
|
44
44
|
# Drizzle checking with explicit schema path
|
|
45
45
|
rr --check drizzle --drizzle-schema src/db/schema.ts
|
|
46
|
+
|
|
47
|
+
# Extract SQL queries from Drizzle ORM code
|
|
48
|
+
rr sql --drizzle
|
|
49
|
+
|
|
50
|
+
# Extract queries from a specific file
|
|
51
|
+
rr sql --drizzle app/routes/users.tsx
|
|
52
|
+
|
|
53
|
+
# SQL output as JSON
|
|
54
|
+
rr sql --drizzle --format json
|
|
46
55
|
```
|
|
47
56
|
|
|
48
57
|
## Checks
|
|
@@ -70,10 +79,28 @@ rr --check drizzle --drizzle-schema src/db/schema.ts
|
|
|
70
79
|
Some hydration issues are auto-fixable (e.g., adding `{ timeZone: "UTC" }` to locale methods, replacing `uuid()` with `useId()`).
|
|
71
80
|
|
|
72
81
|
- **drizzle** (persistence): Validates database operations against Drizzle ORM schema. Auto-discovers schema from common locations (`db/schema.ts`, `src/db/schema.ts`, etc.) or use `--drizzle-schema` for custom paths.
|
|
82
|
+
- Unknown table or column references in `db.insert()`, `db.update()`, `db.delete()`
|
|
73
83
|
- Missing required columns on `db.insert()` calls
|
|
74
|
-
-
|
|
84
|
+
- Null literal assigned to `notNull` column (insert or update)
|
|
85
|
+
- Invalid enum literal values (checked against schema-defined allowed values)
|
|
86
|
+
- Type mismatches: string from `formData.get()` to integer, boolean, timestamp, or json column
|
|
87
|
+
- Writing to auto-generated columns (e.g., serial, auto-increment) on insert
|
|
88
|
+
- `DELETE` or `UPDATE` without `.where()` clause (affects all rows)
|
|
75
89
|
- Enum columns receiving unvalidated external input
|
|
76
90
|
|
|
91
|
+
## SQL Query Extraction
|
|
92
|
+
|
|
93
|
+
The `rr sql` command extracts database queries from ORM code and generates equivalent SQL statements.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
rr sql --drizzle # extract all SQL queries
|
|
97
|
+
rr sql --drizzle app/routes/users.tsx # extract from specific file
|
|
98
|
+
rr sql --drizzle --format json # JSON output
|
|
99
|
+
rr sql --drizzle --drizzle-schema db/schema.ts # explicit schema path
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Supports SELECT, INSERT, UPDATE, and DELETE patterns with parameterized queries and column type inference from the schema.
|
|
103
|
+
|
|
77
104
|
## Programmatic API
|
|
78
105
|
|
|
79
106
|
```typescript
|