Last Updated: 3/9/2026
PocketBase Documentation Gap Analysis
Overview
This analysis identifies gaps between the PocketBase codebase and existing documentation, with recommendations for improvement.
Analysis Date: 2024 Repository: pocketbase/pocketbase Documentation Source: pocketbase.io/docs Total Existing Articles: 49
Executive Summary
Current Documentation Coverage
The existing documentation covers:
- ✅ API Endpoints: Comprehensive coverage (Records, Collections, Files, Backups, Health, Logs, Realtime, Settings, Crons)
- ✅ JavaScript SDK: Good coverage (Overview, Collections, Records, Database, Event Hooks, Migrations, etc.)
- ✅ Go Framework: Good coverage (Overview, Collections, Records, Database, Event Hooks, Migrations, etc.)
- ✅ Getting Started: Basic guides (Authentication, Files, Relations, Production)
- ✅ Core Concepts: Collections, Authentication, Files handling
Key Gaps Identified
- Core Package Documentation (HIGH PRIORITY)
- Field Types Reference (HIGH PRIORITY)
- Tools Package (MEDIUM PRIORITY)
- Advanced Use Cases (MEDIUM PRIORITY)
- Migration Guides (LOW PRIORITY)
Detailed Gap Analysis
1. Core Package Documentation (HIGH PRIORITY)
Current State
- Limited documentation on core package internals
- No comprehensive field types reference
- Missing validator documentation
Identified Gaps
Field Interface & Types
- Missing: Comprehensive guide on the Field interface
- Found in code:
core/field.godefines:- Field interface with methods:
GetId(),SetId(),GetName(),Type(),ColumnType(),PrepareValue(),ValidateValue(),ValidateSettings() - 15+ field types: Text, Number, Boolean, Email, URL, Date, Autodate, Select, File, Relation, JSON, Editor, Password, GeoPoint
- Field modifiers:
SetterFinder,GetterFinder,DriverValuer,MultiValuer,RecordInterceptor - System field names constants
- Field interface with methods:
Recommended Documentation:
- “Field Types Reference” - Complete guide to all field types
- “Custom Field Types” - How to create custom fields
- “Field Validation” - Built-in validators and custom validation
- “Field Interceptors” - Using RecordInterceptor for custom logic
Record Model Extensions
- Missing: Advanced Record manipulation guide
- Found in code:
core/record_model.go: Record struct with Get/Set methodscore/record_proxy.go: RecordProxy for typed accesscore/record_tokens.go: Token generationcore/record_field_resolver.go: Field resolution and expansion
Recommended Documentation:
- “Working with Records (Advanced)” - Deep dive into Record API
- “Record Proxies” - Type-safe record access
- “Field Resolvers” - Custom field resolution logic
Collection Management
- Missing: Programmatic collection management guide
- Found in code:
core/collection_model.go: Collection structcore/collection_import.go: Collection import/exportcore/collection_validate.go: Collection validation- Auth, Base, and View collection options
Recommended Documentation:
- “Collections (Programmatic)” - Creating/updating collections in code
- “Collection Types” - Auth vs Base vs View collections
- “Collection Import/Export” - Backup and restore strategies
Database Operations
- Missing: Advanced database query patterns
- Found in code:
core/db.go: Database connection managementcore/db_builder.go: Query buildercore/db_tx.go: Transaction handlingcore/db_retry.go: Retry logic
Recommended Documentation:
- “Database Queries (Advanced)” - Complex queries and joins
- “Transactions” - Managing database transactions
- “Connection Pooling” - Concurrent vs non-concurrent DB
2. API Package Documentation (MEDIUM PRIORITY)
Current State
- Good API endpoint documentation
- Missing middleware documentation
- Limited custom endpoint examples
Identified Gaps
Middlewares
- Found in code:
apis/middlewares*.go- Body limit middleware
- CORS middleware
- Gzip middleware
- Rate limit middleware
Recommended Documentation:
- “Middlewares” - Built-in and custom middleware
- “Rate Limiting” - Configuration and custom rules
- “CORS Configuration” - Cross-origin setup
Custom Endpoints
- Missing: Comprehensive guide on custom API endpoints
- Found in code:
apis/base.go,apis/serve.go
Recommended Documentation:
- “Custom API Endpoints” - Creating custom routes
- “Request/Response Handling” - Working with RequestEvent
3. Tools Package Documentation (MEDIUM PRIORITY)
Current State
- No documentation on utility packages
- Missing common patterns and helpers
Identified Gaps
Available Tools (from tools/ directory):
archive- Archive operationsauth- Authentication utilitiescron- Cron job schedulingdbutils- Database utilitiesfilesystem- File system operationshook- Hook systeminflector- String inflectionlist- List utilitieslogger- Loggingmailer- Email sendingosutils- OS utilitiespicker- Data pickerrouter- Routing utilitiesroutine- Goroutine helperssearch- Search utilitiessecurity- Security helpersstore- Key-value storesubscriptions- Realtime subscriptionstemplate- Template renderingtokenizer- Token parsingtypes- Type utilities
Recommended Documentation:
- “Utility Packages” - Overview of all tools
- “Filesystem Operations” - File upload/download patterns
- “Mailer” - Email templates and sending
- “Cron Jobs” - Scheduled tasks
- “Security Helpers” - Encryption, hashing, random generation
4. Advanced Use Cases (MEDIUM PRIORITY)
Missing Guides
Multi-tenancy
- No guide on implementing multi-tenant applications
- Missing isolation patterns
Recommended Documentation:
- “Multi-Tenancy Patterns” - Implementing tenant isolation
- “Data Isolation” - Collection-level vs record-level
Performance Optimization
- Limited performance tuning documentation
- Missing indexing strategies
Recommended Documentation:
- “Performance Tuning” - Optimization strategies
- “Indexing Best Practices” - When and how to index
- “Query Optimization” - Writing efficient queries
Testing
- Basic testing guide exists
- Missing integration testing patterns
Recommended Documentation:
- “Testing Strategies” - Unit, integration, and E2E testing
- “Test Helpers” - Using ApiScenario and test utilities
Security
- Basic authentication covered
- Missing advanced security topics
Recommended Documentation:
- “Security Best Practices” - Comprehensive security guide
- “API Rules Patterns” - Common access control patterns
- “Rate Limiting Strategies” - Protecting your API
5. Migration and Changelog (LOW PRIORITY)
Current State
- Excellent CHANGELOG.md with detailed version history
- v0.23 upgrade guides exist
Identified Gaps
Version Migration
- Missing: Migration guides for older versions
- Exists: CHANGELOG.md with comprehensive history from v0.8 to v0.36+
Recommended Documentation:
- “Migration Guides” - Step-by-step version upgrades
- “Breaking Changes” - Summary of breaking changes by version
Field Types Inventory
Core Field Types (from core/field_*.go)
-
Text Field (
field_text.go)- Basic text storage
- Min/max length validation
- Pattern matching
- Autogenerate option
-
Number Field (
field_number.go)- Integer and float support
- Min/max value validation
- OnlyInt option
-
Boolean Field (
field_bool.go)- True/false values
-
Email Field (
field_email.go)- Email validation
- Unique constraint support
-
URL Field (
field_url.go)- URL validation
- HTTP/HTTPS enforcement
-
Date Field (
field_date.go)- Date/time storage
- Format validation
-
Autodate Field (
field_autodate.go)- Auto-populated timestamps
- onCreate/onUpdate triggers
-
Select Field (
field_select.go)- Predefined options
- Single/multiple selection
- MaxSelect option
-
File Field (
field_file.go)- File upload handling
- MaxSelect for multiple files
- MaxSize validation
- MIME type restrictions
- Thumb sizes
-
Relation Field (
field_relation.go)- References to other collections
- Single/multiple relations
- Cascade delete options
- DisplayFields
-
JSON Field (
field_json.go)- Arbitrary JSON storage
- MaxSize validation
-
Editor Field (
field_editor.go)- Rich text content
- MaxSize validation
- Convertible to HTML
-
Password Field (
field_password.go)- Bcrypt hashing
- Min/max length
- Pattern validation
- Cost factor
-
GeoPoint Field (
field_geo_point.go) ⭐ NEW in v0.27- Geographic coordinates
- Longitude/latitude storage
- Distance calculations
Recent Features Requiring Documentation
From CHANGELOG Analysis
v0.36.x (Latest)
strftime()date formatting function- Query optimization improvements
- JSVM
unmarshalhelper
v0.35.x
- Nullable helpers:
nullString(),nullInt(),nullFloat(),nullBool(),nullArray(),nullObject()
v0.34.x
@request.body.someField:changedmodifier- Cron jobs API and UI
v0.33.x
- Auth alert
{ALERT_INFO}placeholder - Extra ID characters validation
v0.32.x
- Enhanced List/Search API rules checks
- Client-side filter security improvements
v0.31.x
- Multiple relation fields visualization
- Ed25519 OIDC support
v0.30.x
- Lark OAuth2 provider
$os.RootJSVM bindings
v0.29.x
- Box.com OAuth2 provider
- Custom network listeners
v0.28.x
toBytes()JSVM helperGetReuploadableFile()method
v0.27.x
- GeoPoint field ⭐
geoDistance()function- Create API rule optimization
Priority Recommendations
Immediate (Next Sprint)
- Field Types Reference - Complete guide with examples for all 14 field types
- GeoPoint Field Guide - New in v0.27, needs documentation
- Advanced Record Operations - Get/Set modifiers, proxies, field resolvers
Short-term (1-2 months)
- Programmatic Collection Management - Creating collections in code
- Middleware Guide - Built-in and custom middleware
- Tools Package Overview - Document utility packages
- Security Best Practices - Comprehensive security guide
Medium-term (3-6 months)
- Performance Tuning Guide - Optimization strategies
- Multi-Tenancy Patterns - Implementing tenant isolation
- Advanced Testing - Integration and E2E testing
- Custom Field Types - Creating custom fields
- Migration Guides - Version upgrade paths
Code Examples Needed
High Priority Examples
- All Field Types - Creation and configuration examples
- GeoPoint Usage - Distance queries and filtering
- Record Proxies - Type-safe record access
- Custom Middlewares - Request/response modification
- Transaction Handling - Multi-operation transactions
- Rate Limiting - Custom rate limit rules
- File Upload Patterns - Single and multiple files
- Relation Expansion - Deep expansion examples
Medium Priority Examples
- Custom Validators - Field-level validation
- Collection Import/Export - Backup strategies
- Cron Jobs - Scheduled task patterns
- Email Templates - Custom mail templates
- OAuth2 Customization - Provider configuration
- View Collections - Complex SQL views
Documentation Structure Recommendations
Proposed New Sections
/docs
/getting-started (existing)
- how-to-use
- authentication
- files-handling
- working-with-relations
- going-to-production
- use-as-framework ✨ ENHANCE
/core-concepts (NEW)
- collections
- records
- fields
- authentication
- realtime
- files
/field-types (NEW) ⭐ HIGH PRIORITY
- overview
- text
- number
- boolean
- email
- url
- date
- autodate
- select
- file
- relation
- json
- editor
- password
- geopoint ✨ NEW
- custom-fields
/api (existing)
- api-records
- api-collections
- api-files
- api-backups
- api-health
- api-logs
- api-realtime
- api-settings
- api-crons
- api-rules-and-filters
/go (existing)
- go-overview
- go-collections ✨ ENHANCE
- go-records ✨ ENHANCE
- go-database ✨ ENHANCE
- go-event-hooks
- go-routing
- go-migrations
- go-testing
- go-realtime
- go-filesystem
- go-sending-emails
- go-rendering-templates
- go-logging
- go-jobs-scheduling
- go-console-commands
- go-miscellaneous
- go-record-proxy (NEW)
/javascript (existing)
- js-overview
- js-collections
- js-records
- js-database
- js-event-hooks
- js-routing
- js-migrations
- js-realtime
- js-filesystem
- js-sending-emails
- js-sending-http-requests
- js-rendering-templates
- js-logging
- js-jobs-scheduling
- js-console-commands
/advanced (NEW) ⭐ MEDIUM PRIORITY
- performance-tuning
- multi-tenancy
- custom-fields
- custom-middlewares
- transactions
- security-best-practices
- testing-strategies
/tools (NEW) ⭐ MEDIUM PRIORITY
- overview
- filesystem
- mailer
- cron
- security
- store
- logger
/migration (NEW)
- upgrading
- breaking-changes
- version-guidesMetrics
Current Documentation
- Total Articles: 49
- API Documentation: 10 articles
- Go Documentation: 17 articles
- JavaScript Documentation: 16 articles
- Getting Started: 5 articles
- Other: 1 article (README)
Recommended Additions
- Field Types: +16 articles
- Core Concepts: +6 articles
- Advanced Topics: +8 articles
- Tools: +8 articles
- Migration: +3 articles
- Enhancements: ~10 existing articles
Total New Content: ~40 articles Total After Completion: ~89 articles
Conclusion
The existing PocketBase documentation provides excellent coverage of API endpoints and basic usage patterns for both Go and JavaScript. However, there are significant opportunities to improve documentation around:
- Core internals - Field types, validators, record operations
- Advanced patterns - Multi-tenancy, performance, security
- Utility packages - Tools and helpers
- New features - GeoPoint fields, recent CHANGELOG additions
By addressing these gaps, PocketBase documentation will become more comprehensive and enable developers to build more sophisticated applications with confidence.
Next Steps
- ✅ Review and approve this gap analysis
- 📝 Create detailed outlines for priority articles
- ✍️ Write and publish high-priority documentation
- 🔄 Establish documentation update process for new releases
- 📊 Track documentation coverage metrics