Farstorm (v1.1.2) is a TypeScript-first ORM for PostgreSQL leveraging structural typing and providing first-access retrieval patterns for efficient querying. It relies on @electric-sql/pglite for PostgreSQL connectivity. Released on npm, it is designed for Node.js 20+ environments with a focus on type safety and developer experience. Differentiators include its unique 'first access' retrieval strategy that minimizes roundtrips and its full TypeScript support with strong type inference for database schemas and queries.
npm install farstormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes Farstorm with a PGlite client and defines a simple model to query the first matching user by email.
Upgrade Node.js to version 20 or later.
Use 'import' statements instead of require(). Ensure your project is configured for ESM (e.g., 'type': 'module' in package.json).
Replace 'pool' with 'client' and use PGlite: new Farstorm({ client: new PGlite(...) }).Manually add UNIQUE constraints or indexes to your database tables.
Install the peer dependency: npm install @electric-sql/pglite
Use named import: import { Farstorm } from 'farstorm'Add 'static table = 'your_table_name';' to your model class.