Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rodydavis/pocketbase_dart_generator
https://github.com/rodydavis/pocketbase_dart_generator
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rodydavis/pocketbase_dart_generator
- Owner: rodydavis
- License: apache-2.0
- Created: 2022-09-24T12:50:14.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-31T17:12:12.000Z (about 1 year ago)
- Last Synced: 2024-10-09T12:24:06.698Z (about 1 month ago)
- Language: Dart
- Size: 335 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-pocketbase - GitHub - 2.0 | (Dart)
- awesome-pocketbase - GitHub - 2.0 | (Dart)
- awesome-pocketbase - Dart Generator - Generate type safe client SDKs for use in local SQLite, JSON or GraphQL resolvers. ![GitHub Repo stars](https://img.shields.io/github/stars/rodydavis/pocketbase_dart_generator) (Dart/Flutter)
README
# Pocketbase Dart Generator
Generate `json_serializable` and `hive_generator` classes for use with PocketBase client and app caching.
## Library Usage
Create an instance of the client:
```dart
final client = PocketBaseGenerator(
'POCKETBASE_URL',
authenticate: (client) => client.admins.authViaEmail(
'ADMIN_USERNAME',
'ADMIN_PASSWORD',
),
);
```Then call the generate function to create files at the specified output directory:
```dart
await client.generate(hive: true);
```## CLI Usage
Clone the repo locally and run the following command:
```bash
dart bin/pocketbase_dart_generator.dart -u ADMIN_USERNAME -p ADMIN_PASSWORD -l POCKETBASE_URL
```## Known Limitations
- [ ] Not all types supported
- [ ] Enums not generated for options
- [ ] Deletes not yet supported (Hive Client)