Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
patmood committed Nov 27, 2024
1 parent f10506d commit 776dc51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ This will produce types for all your PocketBase collections to use in your front
## Version Support

| PocketBase | pocketbase-typegen | npx command |
|------------|--------------------| ------------------------------------------------------------------------------ |
| v0.23.x | v1.2.x | npx pocketbase-typegen --db ./pb_data/data.db --out pocketbase-types.ts |
| v0.8.x | v1.1.x | npx [email protected] --db ./pb_data/data.db --out pocketbase-types.ts |
| ---------- | ------------------ | ------------------------------------------------------------------------------ |
| v0.23.x | v1.3.x | npx pocketbase-typegen --db ./pb_data/data.db --out pocketbase-types.ts |
| v0.18.x | v1.2.x | npx [email protected] --db ./pb_data/data.db --out pocketbase-types.ts |
| v0.8.x | v1.1.x | npx [email protected] --db ./pb_data/data.db --out pocketbase-types.ts |
| v0.7.x | v1.0.x | npx [email protected] --db ./pb_data/data.db --out pocketbase-types.ts |

## Usage
Expand Down Expand Up @@ -83,10 +84,10 @@ Using PocketBase SDK v0.18.3+, collections can be [automatically typed](https://
```typescript
import { TypedPocketBase } from "./pocketbase-types"

const pb = new PocketBase('http://127.0.0.1:8090') as TypedPocketBase
const pb = new PocketBase("http://127.0.0.1:8090") as TypedPocketBase

await pb.collection('tasks').getOne("RECORD_ID") // -> results in TaskResponse
await pb.collection('posts').getOne("RECORD_ID") // -> results in PostResponse
await pb.collection("tasks").getOne("RECORD_ID") // -> results in TaskResponse
await pb.collection("posts").getOne("RECORD_ID") // -> results in PostResponse
```

Alternatively, you can use generic types for each request, eg:
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ async function main(options2) {
import { program } from "commander";

// package.json
var version = "1.2.1";
var version = "1.3.0";

// src/index.ts
program.name("Pocketbase Typegen").version(version).description(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pocketbase-typegen",
"version": "1.2.1",
"version": "1.3.0",
"description": "Generate pocketbase record types from your database",
"main": "dist/index.js",
"bin": {
Expand Down

0 comments on commit 776dc51

Please sign in to comment.