{"id":13489270,"url":"https://github.com/gavanitrate/faunadb-http-dart","last_synced_at":"2025-09-30T12:30:38.972Z","repository":{"id":53755051,"uuid":"273348556","full_name":"gavanitrate/faunadb-http-dart","owner":"gavanitrate","description":"A pure Dart implementation of a FaunaDB client and provides query classes that closely mimic FQL functions.","archived":false,"fork":false,"pushed_at":"2024-01-10T09:21:05.000Z","size":185,"stargazers_count":33,"open_issues_count":3,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T16:00:03.685Z","etag":null,"topics":["dart","database","faunadb","flutter"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gavanitrate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-18T22:02:54.000Z","updated_at":"2024-03-30T13:30:27.000Z","dependencies_parsed_at":"2024-01-16T09:05:23.336Z","dependency_job_id":"4b7ebb0b-ae94-4fa7-8a10-f2ecce5a61b8","html_url":"https://github.com/gavanitrate/faunadb-http-dart","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavanitrate%2Ffaunadb-http-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavanitrate%2Ffaunadb-http-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavanitrate%2Ffaunadb-http-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavanitrate%2Ffaunadb-http-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavanitrate","download_url":"https://codeload.github.com/gavanitrate/faunadb-http-dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234733007,"owners_count":18878417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","database","faunadb","flutter"],"created_at":"2024-07-31T19:00:21.563Z","updated_at":"2025-09-30T12:30:38.557Z","avatar_url":"https://github.com/gavanitrate.png","language":"Dart","funding_links":[],"categories":["Tools"],"sub_categories":["Community drivers"],"readme":"# faunadb-http\n\nA pure Dart implementation of a [FaunaDB][faunadb] client. This library also provides query classes that closely mimic\nFQL functions.\n\n[faunadb]: https://fauna.com/\n\n## Usage\n\n### Basic Example\n\n```dart\nimport 'package:faunadb_http/faunadb_http.dart';\nimport 'package:faunadb_http/query.dart';\n\nvoid main() async {\n  final config = FaunaConfig.build(\n    secret: '\u003cyour_secret_here\u003e',\n  );\n  final client = FaunaClient(config);\n\n  final query = Paginate(Match(Index('all_customers')));\n\n  final result = await client.query(query);\n  print(result);\n\n  client.close();\n}\n```\n\n### Writing Queries\n\nAfter importing the query classes from this package\n(as in the example above), your queries will look almost identical to [FQL][fql].\n\nCheck out the [FQL Cheat Sheet][cheat_sheet] to see all valid FQL functions.\n\n[fql]: https://docs.fauna.com/fauna/current/api/fql/\n\n[cheat_sheet]: https://docs.fauna.com/fauna/current/api/fql/cheat_sheet\n\n#### Example Queries\n\n```dart\n// segment from example/crud.dart\n\n//\n// create\n//\n\nfinal createCollection = CreateCollection(Obj({'name': 'users'}));\n\nfinal createDocument = Create(\n  Collection('users'),\n  Obj({\n    'data': {'name': 'Gavan Singh'}\n  }),\n);\n\nfinal createIndex = CreateIndex(Obj({\n  'name': 'user-by-name',\n  'source': Collection('users'),\n  'terms': [\n    {\n      'field': ['data', 'name']\n    }\n  ]\n}));\n\nfinal createFunction = CreateFunction(Obj({\n  'name': 'double',\n  'body': Query(Lambda('x', Add([Var('x'), Var('x')])))\n}));\n\n//\n// read\n//\n\nfinal callDoubleFunction = Call(Function_('double'), arguments: 2);\n\nfinal paginateUsers = Paginate(\n  Match(Index('user-by-name'), terms: ['Gavan Singh']),\n);\n\nfinal readUser = Get(Ref(Collection('users'), '281080202238362125'));\n\nfinal readAllUsers = Map_(\n  Paginate(Match(Index('all_Users'))),\n  Lambda(\n    'userRef',\n    Let(\n      {\n        'userDoc': Get(Var('userRef')),\n      },\n      Obj(\n        {\n          'id': Select(['ref', 'id'], Var('userDoc')),\n          'name': Select(['data', 'name'], Var('userDoc')),\n        },\n      ),\n    ),\n  ),\n);\n\nfinal paginateCollections = Paginate(Collections());\n\n//\n// update\n//\n\nfinal updateUser = Update(\n  Ref(Collection('users'), '281080202238362125'),\n  Obj({\n    'data': {'isCool': true}\n  }),\n);\n\n//\n// delete\n//\n\nfinal deleteUser = Delete(Ref(Collection('users'), '281080202238362125'));\n\n```\n\n### Query Differences\n\nThere are some cases where your queries will have to be written slightly differently from pure FQL. Here are examples of\neach type of difference.\n\n- Optional FQL arguments are named arguments in Dart.\n    - `Repeat('x', number: 10)`\n    - `Paginate(Collections(), size: 2)`\n\n- FQL functions with a variable number of arguments (such as Sum, GT etc.) accept a Dart List instead.\n    - `Add([1, Var('x')])`\n\n- Some FQL functions and arguments are reserved keywords in Dart; simply add a trailing underscore to them.\n    - `Map` becomes `Map_`\n    - `Function` becomes `Function_`\n    - `default` becomes `default_`\n\n## Build\n\nThe `json_serializable` package provides JSON serialization to the query classes.\n\nRun `pub run build_runner build` to generate the boilerplate code to add JSON serialization.\n\n`pub run build_runner watch` is great when trying things out.\n\n## Contributors\n\nCan be found in `CONTRIBUTORS.md`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavanitrate%2Ffaunadb-http-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavanitrate%2Ffaunadb-http-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavanitrate%2Ffaunadb-http-dart/lists"}