{"id":42161,"library":"typed-orm","title":"typed-orm","description":"A structurally-typed MySQL query builder and ORM for TypeScript, leveraging advanced type system features for compile-time query safety. Version 1.39.1 (latest) is the final release; the project is deprecated with no further updates. Key differentiator: focus on structural typing (not nominal) for precise column type tracking, but superseded by the @squill family of packages (squill, mysql-5.7, sqlite3-browser) which offer similar safety with broader database support.","status":"deprecated","version":"1.39.1","language":"javascript","source_language":"en","source_url":"https://github.com/AnyhowStep/typed-orm","tags":["javascript","typescript"],"install":[{"cmd":"npm install typed-orm","lang":"bash","label":"npm"},{"cmd":"yarn add typed-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add typed-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL database driver for runtime connections","package":"mysql2","optional":false},{"reason":"Peer dependency for type safety; version >=3.8 required for structural typing features","package":"typescript","optional":true}],"imports":[{"note":"ESM-only; CJS require breaks because package uses export assignments.","wrong":"const { Table } = require('typed-orm')","symbol":"Table","correct":"import { Table } from 'typed-orm'"},{"note":"Do not use internal paths; they are not part of the public API and may change.","wrong":"import { SelectQuery } from 'typed-orm/lib/SelectQuery'","symbol":"SelectQuery","correct":"import { SelectQuery } from 'typed-orm'"},{"note":"Row utilities are in a separate subpath export; direct import from root may be undefined.","wrong":"import { WithRow } from 'typed-orm'","symbol":"WithRow","correct":"import { WithRow } from 'typed-orm/row'"}],"quickstart":{"code":"import { Table, Column, InsertQuery } from 'typed-orm';\n\nconst myTable = Table('my_table', {\n  id: Column<number>({ primaryKey: true }),\n  name: Column<string>({ dataType: 'VARCHAR(255)' }),\n});\n\nasync function insertRow(connection: any) {\n  const query = InsertQuery.into(myTable, ['id', 'name'])\n    .values({ id: 1, name: 'Alice' })\n    .toSql();\n  await connection.query(query.sql, query.values);\n}","lang":"typescript","description":"Defines a table with structurally typed columns and performs an insert using the typed query builder."},"warnings":[{"fix":"Migrate to @squill/squill and corresponding database-specific packages.","message":"The package is deprecated and should not be used for new projects.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Update column definitions to { primaryKey: true } to { primaryKey: { autoIncrement: false } } or similar.","message":"Change in primary key handling between v1.0 and v1.1: primaryKey property changed from boolean to object with autoIncrement option.","severity":"breaking","affected_versions":">=1.0.0 <1.1.0"},{"fix":"Use explicit type assertions if literal type narrowing is required.","message":"Method .whereEq() does not narrow column type literals (e.g., 'test' remains string, not literal 'test'), which differs from typical tagged literal types.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure columns have case-sensitive collation or use BINARY keyword in comparisons.","message":"Case-insensitive collations cause .whereEq to match case-insensitively; may return rows with different casing.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Only import public API from the root or documented subpath exports (e.g., 'typed-orm/row').","message":"Removal of deprecated non-exported symbols (e.g., internal helper interfaces) in v1.30 — imported via deep paths broke.","severity":"breaking","affected_versions":">=1.30.0"}],"env_vars":null,"search_vec":"'-5.7':64 '1.39.1':27 'advanc':16 'broader':73 'browser':67 'builder':10 'column':51 'compil':22 'compile-tim':21 'databas':74 'deprec':36 'differenti':42 'famili':59 'featur':19 'final':31 'focus':43 'javascript':76 'key':41 'latest':28 'leverag':15 'mysql':8,63 'nomin':48 'offer':69 'orm':3,12 'packag':61 'precis':50 'project':34 'queri':9,24 'releas':32 'safeti':25,71 'similar':70 'sqlite3':66 'sqlite3-browser':65 'squill':58,62 'structur':6,45 'structurally-typ':5 'supersed':55 'support':75 'system':18 'time':23 'track':53 'type':2,7,17,46,52 'typed-orm':1 'typescript':14,77 'updat':40 'version':26","created_at":"2026-06-04T18:55:54.631576+00:00","updated_at":"2026-06-04T18:55:54.631576+00:00","problems":[{"fix":"Run 'npm install typed-orm' and ensure import path is correct.","cause":"Missing npm install or package name typo","error":"Cannot find module 'typed-orm'"},{"fix":"Explicitly specify column names in order matching the insert array, e.g., .values({ id: 1 }) instead of positional values.","cause":"Column type inference failure when using .values() with mismatched column order","error":"Type 'number' is not assignable to type 'never'"},{"fix":"Call .toSql() on the query object first to get { sql, values }.","cause":"Trying to access .sql or .values before calling .toSql()","error":"Property 'sql' does not exist on type 'Query'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/AnyhowStep/typed-orm#readme","github":"https://github.com/AnyhowStep/typed-orm","docs":null,"changelog":null,"pypi":null,"npm":"typed-orm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}