Warp Server is an Object-Relational Mapper (ORM) designed for scalable web applications, currently at version 6.8.7. It provides a structured approach to defining database schemas, including tables, columns with validation, and triggers for pre- and post-operation hooks. Developers can build complex queries, implement server-side functions for custom business logic, and enforce access restrictions based on user roles. A key differentiator is its built-in support for implementing RESTful APIs via an Express middleware. As of now, it exclusively supports MySQL, with the roadmap indicating plans for additional database adapters in future releases. The project maintains a stable release cadence, with version 6.x being the current focus, explicitly differentiating its documentation and usage from older versions 5.x and legacy releases.
npm install warp-serverVerified import paths — ran on the pinned version, not inferred.
Initializes a Warp service instance with a MySQL database connection, demonstrating the basic setup and asynchronous initialization.
Refer to the `readme-v6.md` (or relevant version) documentation for migration guides and updated API usage. Do not mix dependencies from different major versions.
Add or ensure the presence of `"experimentalDecorators": true` and `"emitDecoratorMetadata": true` in your `tsconfig.json`'s `"compilerOptions"`.
Install `reflect-metadata` via `npm install --save reflect-metadata` and add `import 'reflect-metadata';` at the very top of your main application file (e.g., `index.ts`).
Ensure your `databaseURI` is configured for a MySQL connection. Check the documentation for updates on support for other database systems if needed.
Ensure `import 'reflect-metadata';` is at the top of your main application file and `"emitDecoratorMetadata": true` is in your `tsconfig.json`.
Use ES Module `import Warp from 'warp-server';` syntax. If using Node.js, ensure your package.json has `"type": "module"` or your file uses the `.mjs` extension, and/or your TypeScript compiler options (`moduleResolution`, `esModuleInterop`) are correctly set for ESM.