{"id":43834,"library":"simple-notion-orm","title":"simple-notion-orm","description":"Simple Notion ORM is a schema-first TypeScript ORM for Notion's Data Sources API, built on top of @notionhq/client. Current version 0.0.15 is early and experimental, with no stable release cadence. It provides Drizzle-inspired table definitions, column builders (text, number, status, relation, people, and metadata helpers), and two page abstractions (standalone pages and database rows) with typed codecs for parsing and encoding Notion payloads. Requires Node.js >= 22 and pnpm; ESM-only. Key differentiator: turns Notion's flexible but verbose API into a typed, Drizzle-like workflow with automatic payload transformation.","status":"active","version":"0.0.15","language":"javascript","source_language":"en","source_url":"https://github.com/abhinsharma/simple-notion-orm","tags":["javascript","notion","orm","notion-api","notion-database","typescript"],"install":[{"cmd":"npm install simple-notion-orm","lang":"bash","label":"npm"},{"cmd":"yarn add simple-notion-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add simple-notion-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Underlying Notion API client","package":"@notionhq/client","optional":false}],"imports":[{"note":"ESM-only package; require() will throw. Also, note that the package uses subpath exports; ensure your runtime supports them.","wrong":"const { defineTable } = require('simple-notion-orm')","symbol":"defineTable","correct":"import { defineTable } from 'simple-notion-orm'"},{"note":"Column builders are exported from 'simple-notion-orm/schema', not the main entry. This is a common mistake.","wrong":"import { text } from 'simple-notion-orm'","symbol":"text","correct":"import { text } from 'simple-notion-orm/schema'"},{"note":"Same as text; all column builders are under the /schema subpath.","wrong":"import { status } from 'simple-notion-orm'","symbol":"status","correct":"import { status } from 'simple-notion-orm/schema'"}],"quickstart":{"code":"import { defineTable, text, status, people } from 'simple-notion-orm/schema';\n\nconst tasks = await defineTable(\n  'Tasks',\n  {\n    title: text('Name').title(),\n    assignees: people('Assignees').optional(),\n    status: status('Status').nullable(),\n  },\n  { databaseId: process.env.NOTION_TASKS_DB ?? '' }\n);\n\nawait tasks.insert({\n  title: 'Ship ORM codecs',\n  assignees: [{ id: 'user-123' }],\n  status: { name: 'In Progress' },\n});\n\nconst rows = await tasks.select();\nconsole.table(rows);","lang":"typescript","description":"Defines a Notion table schema using Drizzle-style column builders, inserts a row, and selects all rows."},"warnings":[{"fix":"Upgrade Node.js to v22 or later.","message":"Requires Node.js >= 22.0.0; lower versions will fail to run.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use import syntax or dynamic import() if in a CJS context.","message":"ESM-only package (type: module). CommonJS require() will throw ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use import { text } from 'simple-notion-orm/schema'.","message":"Column builders (text, number, status, etc.) must be imported from 'simple-notion-orm/schema', not the main module.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use { databaseId: string } as the third argument to defineTable.","message":"Passing databaseId directly to defineTable options is the only supported way; older alpha versions used a different config shape.","severity":"deprecated","affected_versions":"<0.0.15"}],"env_vars":null,"search_vec":"'0.0.15':28 '22':75 'abstract':58 'api':20,89,106 'automat':98 'builder':46 'built':21 'cadenc':37 'codec':66 'column':45 'current':26 'data':18 'databas':62,109 'definit':44 'differenti':82 'drizzl':41,94 'drizzle-inspir':40 'drizzle-lik':93 'earli':30 'encod':70 'esm':79 'esm-on':78 'experiment':32 'first':12 'flexibl':86 'helper':54 'inspir':42 'javascript':101 'key':81 'like':95 'metadata':53 'node.js':74 'notion':3,6,16,71,84,102,105,108 'notion-api':104 'notion-databas':107 'notionhq/client':25 'number':48 'orm':4,7,14,103 'page':57,60 'pars':68 'payload':72,99 'peopl':51 'pnpm':77 'provid':39 'relat':50 'releas':36 'requir':73 'row':63 'schema':11 'schema-first':10 'simpl':2,5 'simple-notion-orm':1 'sourc':19 'stabl':35 'standalon':59 'status':49 'tabl':43 'text':47 'top':23 'transform':100 'turn':83 'two':56 'type':65,92 'typescript':13,110 'verbos':88 'version':27 'workflow':96","created_at":"2026-06-05T17:01:42.454646+00:00","updated_at":"2026-06-05T17:01:42.454646+00:00","problems":[{"fix":"Change to import syntax or use dynamic import() in a CommonJS module.","cause":"Using CommonJS require() on an ESM-only package with 'type': 'module'.","error":"ERR_REQUIRE_ESM: require() of ES Module not supported"},{"fix":"Ensure Node.js >= 22 and update the package to the latest version 0.0.15.","cause":"Your runtime does not support subpath exports or the package version is too old.","error":"Cannot find module 'simple-notion-orm/schema'"},{"fix":"Use text('Name').title().","cause":"Column builder .title() method called on undefined; likely forgot to call text() first.","error":"TypeError: Cannot read properties of undefined (reading 'title')"}],"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/abhinsharma/simple-notion-orm#readme","github":"https://github.com/abhinsharma/simple-notion-orm","docs":null,"changelog":null,"pypi":null,"npm":"simple-notion-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-05","next_check":"2026-09-03","install_tag":null}}