rodydavis / pocketbase_dart_generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

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:

await client.generate(hive: true);

CLI Usage

Clone the repo locally and run the following command:

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)

About

License:Apache License 2.0


Languages

Language:Dart 39.3%Language:C++ 27.2%Language:CMake 24.0%Language:Ruby 3.5%Language:HTML 2.4%Language:C 1.8%Language:Swift 1.6%Language:Kotlin 0.2%Language:Objective-C 0.0%