A lightweight TypeScript ORM for MySQL, inspired by ThinkPHP's chaining syntax. Version 1.0.3 provides a fluent query builder with chainable where, join, order, paginate, and union methods. Automatically generates table names from class names (camelCase to snake_case). Supports timestamps, raw SQL, and debugging via fetchSql. Differentiates itself by minimal configuration and familiar PHP-style chaining for TypeScript/Node.js developers. Ships TypeScript types. Current version stable with monthly releases.
npm install tyno-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows configuring a database connection, defining a model, and querying users with a where clause and limit.
Use import syntax; if using CommonJS, use dynamic import or transpile.
Define a class that extends Model (e.g., class User extends Model {}) before calling static methods.Use where('field', 'operator', value) for non-default operators.When using whereRaw or orderRaw, prepend the prefix if needed (e.g., 'ty_' + 'user').
Use query.toSql() and query.getBindings() for SQL debugging.
Use import { Model } from 'tyno-orm' (ESM) and ensure the package is installed.Run npm install mysql2 alongside tyno-orm.
Ensure class User extends Model and import Model as named export.
Use where(clause, params) or whereRaw with positional placeholders (?) instead of string interpolation.