matlab-map-database-objects

Generate MATLAB ORM code mapping classes to database tables.

883|109|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-map-database-objects
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-map-database-objects
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/reporting-and-database-access/matlab-map-database-objects
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-map-database-objects

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you reliably map MATLAB classes to relational database tables and generate correct Database Toolbox ORM (Object Relational Mapping) code, so your agent can perform object-based CRUD without hand-writing fragile SQL and mapping logic.

Core Features & Use Cases

  • Mappable class generation: Creates MATLAB classes that inherit from database.orm.mixin.Mappable and define property-to-column mappings.
  • CRUD with ORM functions: Uses ormread, ormwrite, and ormupdate for reading, inserting, and updating mapped objects.
  • Schema generation and validation: Supports orm2sql to generate and inspect CREATE TABLE SQL from class definitions.
  • Object-oriented database workflows: Enables class-based business logic layered on top of relational storage.

Use it when you need to map an entity (for example, an Employee or Product) into a relational table and then read/update records through strongly-typed MATLAB objects.

Quick Start

Ask your AI to generate a Database Toolbox ORM Mappable class that maps your MATLAB properties to your database columns, then show the SQL it would generate using orm2sql for the target table and execute ormwrite/ormread/ormupdate in a workflow.

Frequently Asked Questions about matlab-map-database-objects

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I map MATLAB classes to database tables for object-based CRUD operations?

To map MATLAB classes to database tables, you generate classes inheriting from database.orm.mixin.Mappable with defined TableName and PrimaryKey properties, enabling object-based CRUD workflows without writing manual SQL mapping logic.

What MATLAB functions read and write database records as strongly-typed objects?

The ormread, ormwrite, and ormupdate functions read, insert, and update mapped relational database records as strongly-typed MATLAB objects, replacing fragile hand-written SQL statements with reliable object-relational mapping workflows.

Do I need Database Toolbox and a specific MATLAB version to use ORM features?

Yes, you need MATLAB R2023b or later with Database Toolbox installed to use ORM features, as the ORM functions and database.orm.mixin.Mappable conventions require this environment to execute object-based database workflows.

How do I generate and validate CREATE TABLE SQL from MATLAB class definitions?

You generate and validate CREATE TABLE SQL from MATLAB class definitions using the orm2sql function, which inspects the mappable class property-to-column mappings to produce the corresponding relational database schema.

What is the best way to avoid writing fragile SQL when managing relational data in MATLAB?

Using MATLAB Object Relational Mapping is the best way to avoid writing fragile SQL, as it generates strongly-typed mappable classes that handle property-to-column mapping and execute CRUD operations through standard ORM functions.

Why does my MATLAB ORM class require an nargin == 0 guard in the constructor?

An nargin == 0 guard in the MATLAB ORM class constructor is a required convention because the Database Toolbox ORM framework needs to instantiate empty mappable objects during internal mapping and query operations.