A TypeScript wrapper for the PocketBase JavaScript SDK that provides full type safety and utility functions.
Typed PocketBase is a TypeScript wrapper for the PocketBase JavaScript SDK that generates TypeScript types from your PocketBase database schema. It provides full type safety for queries, filters, sorting, and relation expansions, reducing runtime errors and improving developer experience when interacting with PocketBase.
TypeScript developers building applications with PocketBase who want type-safe database interactions and enhanced IDE support.
Developers choose Typed PocketBase for its seamless integration with PocketBase, automatic type generation, and comprehensive utility functions that make building complex queries type-safe and intuitive.
Add types to the PocketBase JavaScript SDK
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The CLI tool generates TypeScript types directly from your PocketBase instance, ensuring all collections, fields, and relations are fully typed, as shown in the usage example where types are imported from a generated file.
Provides helper functions like `eq`, `and`, and `or` for building type-safe filters, making query construction intuitive and reducing runtime errors, as demonstrated in the filtering examples.
Allows conditional filtering and sorting where falsy values are automatically excluded, simplifying dynamic query logic without manual cleanup, as illustrated with the `untilNow` variable example.
Supports type-safe expansions up to six levels deep, including back relations, enabling complex nested selects with full IDE support, as shown in the expand section.
Requires running a separate CLI command to generate types, which adds an extra step to the workflow and must be repeated on every schema change, potentially slowing down development cycles.
Expansions are limited to six levels deep, as stated in the README, which might not suffice for applications with extremely nested or complex relation structures.
If PocketBase schema updates are not promptly reflected by regenerating types, the TypeScript definitions can become outdated, leading to silent errors or false positives in type checking.