{"id":44039,"library":"tiny-mysql-orm","title":"tiny-mysql-orm","description":"A lightweight MySQL ORM for Node.js that simplifies database and table creation, as well as insert queries. Currently at version 1.0.13, it supports automatic database/table creation and an insert method with explicit value type handling. Designed for simple use cases with minimal configuration. Lacks advanced query capabilities (select, update, delete), connection pooling, or migration support. Released with an unknown cadence; no recent updates.","status":"active","version":"1.0.13","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","mysql","orm"],"install":[{"cmd":"npm install tiny-mysql-orm","lang":"bash","label":"npm"},{"cmd":"yarn add tiny-mysql-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add tiny-mysql-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for MySQL database connectivity","package":"mysql","optional":false}],"imports":[{"note":"Named export via CommonJS; default import does not exist.","wrong":"const MysqlHandler = require('tiny-mysql-orm');","symbol":"MysqlHandler","correct":"const { MysqlHandler } = require('tiny-mysql-orm');"},{"note":"ESM named import is supported; default import will fail.","wrong":"import MysqlHandler from 'tiny-mysql-orm';","symbol":"MysqlHandler","correct":"import { MysqlHandler } from 'tiny-mysql-orm';"},{"note":"Do not use .default property.","wrong":"const mysqlHandler = require('tiny-mysql-orm').default;","symbol":"MysqlHandler","correct":"const { MysqlHandler } = require('tiny-mysql-orm');"}],"quickstart":{"code":"const { MysqlHandler } = require('tiny-mysql-orm');\n\nconst host_info = {\n  host: 'localhost',\n  user: 'db_user',\n  password: 'my_password',\n  database: 'test_db'\n};\n\nconst tables = [\n  {\n    name: 'users',\n    columns: [\n      { name: 'name', type: 'VARCHAR(128)' },\n      { name: 'email', type: 'VARCHAR(255)' }\n    ],\n    unique: ['email']\n  }\n];\n\nconst handler = new MysqlHandler(host_info, true, tables, false);\n\nconst query = {\n  table: 'users',\n  columns: ['name', 'email'],\n  values: [\n    [\n      { type: 'varchar', value: 'John Doe' },\n      { type: 'varchar', value: 'john@example.com' }\n    ]\n  ]\n};\n\nhandler.insert(query)\n  .then(result => console.log('Inserted:', result))\n  .catch(err => console.error('Error:', err));","lang":"javascript","description":"Shows how to instantiate MysqlHandler with database and table creation, then perform an insert query using explicit value types."},"warnings":[{"fix":"Ensure values are nested correctly per the example.","message":"The insert method requires values to be an array of arrays, each inner array containing objects with 'type' and 'value' properties. Type must be a string like 'varchar', 'int', etc.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Do not include an 'id' column in the columns array when using auto-creation.","message":"When 'create_db' or table creation is enabled, the module automatically adds an 'id' column of type 'INT NOT NULL AUTO_INCREMENT' to every table. This may conflict with user-defined columns.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For pooling, consider using mysql2 with promise wrapper instead.","message":"The module uses synchronous connection creation; it does not support multiple database connections or connection pooling. Each instance uses a single connection.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure database and tables exist before performing insert operations.","message":"No error handling for missing database or table before insert; if table does not exist, the insert will fail with a MySQL error.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.13':25 'advanc':49 'automat':28 'cadenc':64 'capabl':51 'case':44 'configur':47 'connect':55 'creation':16,30 'current':22 'databas':13 'database/table':29 'delet':54 'design':40 'explicit':36 'handl':39 'insert':20,33 'javascript':68 'lack':48 'lightweight':6 'method':34 'migrat':58 'minim':46 'mysql':3,7,69 'node.js':10 'orm':4,8,70 'pool':56 'queri':21,50 'recent':66 'releas':60 'select':52 'simpl':42 'simplifi':12 'support':27,59 'tabl':15 'tini':2 'tiny-mysql-orm':1 'type':38 'unknown':63 'updat':53,67 'use':43 'valu':37 'version':24 'well':18","created_at":"2026-06-05T17:02:41.027058+00:00","updated_at":"2026-06-05T17:02:41.027058+00:00","problems":[{"fix":"Use const { MysqlHandler } = require('tiny-mysql-orm');","cause":"Importing the package as default instead of named export.","error":"TypeError: MysqlHandler is not a constructor"},{"fix":"Run 'npm install mysql'","cause":"Missing peer dependency 'mysql'.","error":"Cannot find module 'mysql'"},{"fix":"Check that MysqlHandler is instantiated with 'new' and call 'insert()' on the instance.","cause":"Instance not properly created or wrong method name.","error":"insert is not a function"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"tiny-mysql-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}}