fix: driver peers are optional; docs sentences that no longer matched the examples; 0.3.1

This commit is contained in:
2026-11-02 22:47:03 +01:00
parent 8fc42bc33b
commit a649a5c1ef
11 changed files with 55 additions and 17 deletions
+6
View File
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased] ## [Unreleased]
## [0.3.1] - 2026-11-03
### Changed
- Each dialect's driver (`pg`, `mysql2`, `mssql`, `better-sqlite3`) is an optional peer dependency: you pass the driver object in, so npm no longer installs one you did not choose. A dialect works with any object offering the driver's API, the SQLite one with sql.js in a browser for example.
- The docs use a to-do app as their example schema.
## [0.3.0] - 2026-11-02 ## [0.3.0] - 2026-11-02
### Added ### Added
+1 -1
View File
@@ -13,7 +13,7 @@ A message never contains SQL or database text.
| Code | Status | Means | | Code | Status | Means |
|---|---|---| |---|---|---|
| `not_found` | 404 | no such resource, or no such row, or a row you may not see | | `not_found` | 404 | no such resource, or no such row, or a row you may not see |
| `method_not_allowed` | 405 | the resource does not allow this method, or a procedure was not called with POST | | `method_not_allowed` | 405 | the resource does not allow this method, or a procedure was called with another method than its own |
| `unknown_column` | 400 | the column does not exist or is hidden | | `unknown_column` | 400 | the column does not exist or is hidden |
| `unknown_relation` | 400 | the relation does not exist | | `unknown_relation` | 400 | the relation does not exist |
| `unknown_operator` | 400 | the operator is not one of `eq neq gt gte lt lte in like ilike match imatch is ov cs cd` | | `unknown_operator` | 400 | the operator is not one of `eq neq gt gte lt lte in like ilike match imatch is ov cs cd` |
+2 -2
View File
@@ -162,7 +162,7 @@ POST /steps
A procedure calls a database function at a path you choose. A `{name}` in the path passes that segment as the argument of the same name; the body's keys pass the others. Arguments are checked by name and type, and one with a default may be left out. A procedure calls a database function at a path you choose. A `{name}` in the path passes that segment as the argument of the same name; the body's keys pass the others. Arguments are checked by name and type, and one with a default may be left out.
A procedure is a POST unless declared `method: 'GET'`. A GET procedure takes its arguments from the query string (`/search?q=vpn&limit=10`), each once, and runs in a read-only transaction: use it for a function without side effects. A procedure is a POST unless declared `method: 'GET'`. A GET procedure takes its arguments from the query string (`/search?q=milk&limit=10`), each once, and runs in a read-only transaction: use it for a function without side effects.
```http ```http
POST /todos/3/complete POST /todos/3/complete
@@ -174,7 +174,7 @@ POST /todos/3/complete
3 3
``` ```
A function returning a set answers an array of its rows. Mail relay belongs to Ada since the update above. A function returning a set answers an array of its rows. File taxes belongs to Ada since the update above.
```http ```http
POST /tags/home/todos POST /tags/home/todos
+27 -7
View File
@@ -3314,7 +3314,7 @@
}, },
"packages/core": { "packages/core": {
"name": "@crudy/restloom", "name": "@crudy/restloom",
"version": "0.3.0", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
"@types/node": "^24.0.0", "@types/node": "^24.0.0",
@@ -3326,7 +3326,7 @@
}, },
"packages/express": { "packages/express": {
"name": "@crudy/restloom-express", "name": "@crudy/restloom-express",
"version": "0.3.0", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@crudy/restloom": "^0.3.0" "@crudy/restloom": "^0.3.0"
@@ -3346,7 +3346,7 @@
}, },
"packages/fastify": { "packages/fastify": {
"name": "@crudy/restloom-fastify", "name": "@crudy/restloom-fastify",
"version": "0.3.0", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@crudy/restloom": "^0.3.0" "@crudy/restloom": "^0.3.0"
@@ -3365,7 +3365,7 @@
}, },
"packages/mssql": { "packages/mssql": {
"name": "@crudy/restloom-mssql", "name": "@crudy/restloom-mssql",
"version": "0.3.0", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@crudy/restloom": "^0.3.0" "@crudy/restloom": "^0.3.0"
@@ -3381,11 +3381,16 @@
}, },
"peerDependencies": { "peerDependencies": {
"mssql": "^12.0.0" "mssql": "^12.0.0"
},
"peerDependenciesMeta": {
"mssql": {
"optional": true
}
} }
}, },
"packages/mysql": { "packages/mysql": {
"name": "@crudy/restloom-mysql", "name": "@crudy/restloom-mysql",
"version": "0.3.0", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@crudy/restloom": "^0.3.0" "@crudy/restloom": "^0.3.0"
@@ -3400,11 +3405,16 @@
}, },
"peerDependencies": { "peerDependencies": {
"mysql2": "^3.11.0" "mysql2": "^3.11.0"
},
"peerDependenciesMeta": {
"mysql2": {
"optional": true
}
} }
}, },
"packages/postgres": { "packages/postgres": {
"name": "@crudy/restloom-postgres", "name": "@crudy/restloom-postgres",
"version": "0.3.0", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@crudy/restloom": "^0.3.0" "@crudy/restloom": "^0.3.0"
@@ -3420,11 +3430,16 @@
}, },
"peerDependencies": { "peerDependencies": {
"pg": "^8.11.0" "pg": "^8.11.0"
},
"peerDependenciesMeta": {
"pg": {
"optional": true
}
} }
}, },
"packages/sqlite": { "packages/sqlite": {
"name": "@crudy/restloom-sqlite", "name": "@crudy/restloom-sqlite",
"version": "0.3.0", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@crudy/restloom": "^0.3.0" "@crudy/restloom": "^0.3.0"
@@ -3440,6 +3455,11 @@
}, },
"peerDependencies": { "peerDependencies": {
"better-sqlite3": ">=12" "better-sqlite3": ">=12"
},
"peerDependenciesMeta": {
"better-sqlite3": {
"optional": true
}
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@crudy/restloom", "name": "@crudy/restloom",
"version": "0.3.0", "version": "0.3.1",
"type": "module", "type": "module",
"description": "A REST API generated from your database's catalog: discovery, a curl-friendly query grammar, relations of every kind, safe defaults", "description": "A REST API generated from your database's catalog: discovery, a curl-friendly query grammar, relations of every kind, safe defaults",
"keywords": ["rest", "api", "postgrest", "sql", "database", "crud", "generator"], "keywords": ["rest", "api", "postgrest", "sql", "database", "crud", "generator"],
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@crudy/restloom-express", "name": "@crudy/restloom-express",
"version": "0.3.0", "version": "0.3.1",
"type": "module", "type": "module",
"description": "Express adapter for restloom", "description": "Express adapter for restloom",
"keywords": [ "keywords": [
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@crudy/restloom-fastify", "name": "@crudy/restloom-fastify",
"version": "0.3.0", "version": "0.3.1",
"type": "module", "type": "module",
"description": "Fastify adapter for restloom", "description": "Fastify adapter for restloom",
"keywords": [ "keywords": [
+4 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@crudy/restloom-mssql", "name": "@crudy/restloom-mssql",
"version": "0.3.0", "version": "0.3.1",
"type": "module", "type": "module",
"description": "SQL Server dialect for restloom", "description": "SQL Server dialect for restloom",
"keywords": [ "keywords": [
@@ -42,6 +42,9 @@
"peerDependencies": { "peerDependencies": {
"mssql": "^12.0.0" "mssql": "^12.0.0"
}, },
"peerDependenciesMeta": {
"mssql": { "optional": true }
},
"devDependencies": { "devDependencies": {
"@types/node": "^24.0.0", "@types/node": "^24.0.0",
"@types/mssql": "^12.0.0", "@types/mssql": "^12.0.0",
+4 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@crudy/restloom-mysql", "name": "@crudy/restloom-mysql",
"version": "0.3.0", "version": "0.3.1",
"type": "module", "type": "module",
"description": "MySQL dialect for restloom", "description": "MySQL dialect for restloom",
"keywords": [ "keywords": [
@@ -41,6 +41,9 @@
"peerDependencies": { "peerDependencies": {
"mysql2": "^3.11.0" "mysql2": "^3.11.0"
}, },
"peerDependenciesMeta": {
"mysql2": { "optional": true }
},
"devDependencies": { "devDependencies": {
"@types/node": "^24.0.0", "@types/node": "^24.0.0",
"mysql2": "^3.24.5", "mysql2": "^3.24.5",
+4 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@crudy/restloom-postgres", "name": "@crudy/restloom-postgres",
"version": "0.3.0", "version": "0.3.1",
"type": "module", "type": "module",
"description": "Postgres dialect for restloom", "description": "Postgres dialect for restloom",
"keywords": ["restloom", "postgres", "postgresql", "rest", "api"], "keywords": ["restloom", "postgres", "postgresql", "rest", "api"],
@@ -23,6 +23,9 @@
"peerDependencies": { "peerDependencies": {
"pg": "^8.11.0" "pg": "^8.11.0"
}, },
"peerDependenciesMeta": {
"pg": { "optional": true }
},
"devDependencies": { "devDependencies": {
"@types/node": "^24.0.0", "@types/node": "^24.0.0",
"@types/pg": "^8.11.0", "@types/pg": "^8.11.0",
+4 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@crudy/restloom-sqlite", "name": "@crudy/restloom-sqlite",
"version": "0.3.0", "version": "0.3.1",
"type": "module", "type": "module",
"description": "SQLite dialect for restloom", "description": "SQLite dialect for restloom",
"keywords": [ "keywords": [
@@ -41,6 +41,9 @@
"peerDependencies": { "peerDependencies": {
"better-sqlite3": ">=12" "better-sqlite3": ">=12"
}, },
"peerDependenciesMeta": {
"better-sqlite3": { "optional": true }
},
"devDependencies": { "devDependencies": {
"@types/node": "^24.0.0", "@types/node": "^24.0.0",
"@types/better-sqlite3": "^7.6.0", "@types/better-sqlite3": "^7.6.0",