A simple Object-Relational Mapping (ORM) system for FaunaDB, version 0.2.36. It provides Model, Field, RefField, and ManyToManyField classes to define schemas with Zod validation, and automatically generates FaunaDB collections, indexes, and queries. It is actively maintained with monthly releases, but has limited documentation and a small user base. The library is ESM-only and requires Zod as a peer dependency.
npm install animal-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines three models (User, Pet, Trick) with fields and relationships, then generates FaunaDB collection/index creation queries.
Use import syntax or set type: 'module' in package.json.
Use the faunadb client's query() method to run the returned expression.
Validate data before creating documents, or wrap in try-catch to handle FaunaDB errors.
Ensure reverse names are unique across your models.
Replace const { Model } = require('animal-orm') with import { Model } from 'animal-orm'.Set moduleResolution to 'node' or 'nodenext' in tsconfig.json.
Ensure the data matches the Zod schema defined in the Field constructor.