Install the "database-connections" agent skill from https://github.com/mendixlabs/mxcli/tree/main/.claude/skills/mendix/database-connections into .claude/skills/database-connections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-connections", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add mendixlabs/mxcli --skill database-connections -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "database-connections" agent skill from https://github.com/mendixlabs/mxcli/tree/main/.claude/skills/mendix/database-connections into .agents/skills/database-connections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-connections", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add mendixlabs/mxcli --skill database-connections -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "database-connections" agent skill from https://github.com/mendixlabs/mxcli/tree/main/.claude/skills/mendix/database-connections into .cursor/skills/database-connections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-connections", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add mendixlabs/mxcli --skill database-connections -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "database-connections" agent skill from https://github.com/mendixlabs/mxcli/tree/main/.claude/skills/mendix/database-connections into .gemini/skills/database-connections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-connections", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add mendixlabs/mxcli --skill database-connections -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "database-connections" agent skill from https://github.com/mendixlabs/mxcli/tree/main/.claude/skills/mendix/database-connections into .github/skills/database-connections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-connections", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add mendixlabs/mxcli --skill database-connections -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "database-connections" agent skill from https://github.com/mendixlabs/mxcli/tree/main/.claude/skills/mendix/database-connections into .opencode/skills/database-connections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-connections", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
database-connections
GitHub stars
128
Token cost
~4.5k tokens
SKILL.md length
1,283 words
Files
1
Skills in repo
72
Repo updated
First seen
Licence
Apache-2.0
At a glance
Connect a Mendix app to an external database over JDBC with the External Database Connector, and define the queries microflows run against it.
Works in 7 steps: Required Mendix Version → Required Non-Persistent Entities → Required Constants → …
The app must read
SKILL.md covers Purpose, When to Use This Skill, Prerequisites and Database Connection Syntax, plus 6 more sections
Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
What it does
Database Connections is an agent skill from mendixlabs/mxcli. Connect a Mendix app to an external database over JDBC with the External Database Connector, and define the queries microflows run against it. Use when the app must read or write Oracle, PostgreSQL, MySQL or SQL Server directly from a microflow.
Its SKILL.md is about 4.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases. It works with PostgreSQL, Microsoft SQL Server, MySQL and SQL. The repository describes itself as: Mendix cli tool, a headless way to work with Mendix projects. Enables Mendix projects for use with 3rd party agentic coding tools like Claude Code and Copilot. Includes a… The licence is Apache-2.0.
When your agent uses it
The app must read
SQL Server directly from a microflow
Example prompts
“/database-connections”
Workflow steps
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 20a6c89. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
No scripts in the folder and no shell commands in SKILL.md (its code samples are sql and bash).
From the folder's file list and the shell code blocks in SKILL.md.
Network
Links to these hosts (documentation or services it may open):
docs.mendix.com
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Database Connections loads about 4.5k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 1,283 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~67
When it runs· the whole SKILL.md, loaded when a task matches
~4.5k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check passed
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
Download SKILL.mdSave it as .claude/skills/database-connections/SKILL.md (or your agent's skills folder).
name
database-connections
description
Connect a Mendix app to an external database over JDBC with the External Database Connector, and define the queries microflows run against it. Use when the app must read or write Oracle, PostgreSQL, MySQL or SQL Server directly from a microflow.
Skill: Create External Database Connections
Purpose
Create and manage external database connections in Mendix using the External Database Connector. This skill helps you set up JDBC connections to external databases (Oracle, PostgreSQL, MySQL, SQL Server, etc.) and define SQL queries that map results to non-persistent entities.
When to Use This Skill
User asks to connect to an external database from a Mendix app (via JDBC)
User needs to query data from Oracle, PostgreSQL, MySQL, SQL Server, or other JDBC databases
User wants to create database connection configurations
User needs to define SQL queries with parameter binding
User wants to map query results to Mendix entities
Tip: Use generate connector to auto-create all constants, entities, and queries from a database schema:
mdl 1;
SQL CONNECT postgres 'postgres://user:pass@host/db' AS source;
SQL source GENERATE CONNECTOR INTO MyModule;
-- Or generate for specific tables and execute immediately:
SQL source GENERATE CONNECTOR INTO MyModule TABLES (employees, departments) EXEC;
For manual exploration, use sql source show tables; and sql source describe tablename;.
Prerequisites
1. Required Mendix Version
Mendix 9.22+ (Database Connector introduced)
Mendix 10.10+ (stable version recommended)
2. Required Non-Persistent Entities
Database query results must be mapped to NON-PERSISTENT entities. Create these first:
The connection's properties are in ( ) and its queries are its children, in
{ } — the shape of every declarative document (R2). The old clause form
(type '…' connection string @… begin query … ; end) still parses and warns
(MDL-DEPR127); mxcli fmt --upgrade rewrites it.
The @ is not optional.ConnectionString, Username and Password are
ConstantIdentifier properties — Mendix stores a reference to a Constant
document, never a value. The grammar accepts a bare string there, but writing
one produces a project that cannot be opened at all:
StorageLoadException: ... has an invalid value '' for property ConnectionString.
The text 'jdbc:postgresql://...' is not a valid ConstantIdentifier.
That is a load failure, not a build error: mx check dies before validating
anything, so the whole project goes down rather than one document. mxcli refuses
it as MDL058 at both check and exec.
sql
-- WRONG — writes an unopenable .mpr
ConnectionString: 'jdbc:postgresql://localhost:5432/app',
Username: 'app'
-- RIGHT — declare the constant, then reference it
create constant Module.DbUrl ( Type: String, DefaultValue: 'jdbc:postgresql://localhost:5432/app' );
create constant Module.DbUser ( Type: String, DefaultValue: 'app' );
ConnectionString: @Module.DbUrl,
Username: @Module.DbUser
The indirection is the point: the constant's value is per-environment, so a
password is configured at deploy time instead of living in the model.
Supported Database Types
These are the values Studio Pro's own connector editor offers — read out of the
shipped bundle at modeler/ide-client/database-connector-editor/, identical on
11.10.0, 11.12.1 and 11.13.0.
Database
Type: value
Studio Pro label
SQL Server
'MSSQL'
Microsoft SQL
MySQL
'MySQL'
MySQL
Oracle
'Oracle'
Oracle
PostgreSQL
'PostgreSQL'
PostgreSQL
Snowflake
'Snowflake'
Snowflake
anything else
'BYOD'
Other
'BYOD' — bring your own driver. Selecting it forces connection-string
configuration and skips the driver-presence check; its only validation is
that the connection string is non-empty. That is the hook for any JDBC driver
Mendix ships no picker entry for (DuckDB, SQLite, ClickHouse, …). Verified end to
end on Mendix 11.13: a booted runtime opened jdbc:duckdb: through a BYOD
connection and returned real rows — the runtime accepts it, not just the editor.
Getting the driver onto the classpath
The driver JAR has to be resolved, and declaring it is not resolving it:
sql
mdl 1;
ALTER MODULE MyModule ADD JAR DEPENDENCY (
group = 'org.duckdb', artifact = 'duckdb_jdbc', version = '1.5.5.1', included = true
);
writes the coordinate to the model — list jar dependencies will report it — and
downloads nothing. MxBuild does not resolve it either: a full
mxbuild --target=deploy emits a build.gradle with no dependencies block. The
first symptom is a runtime SQLException: No JDBC driver found in app for URL,
from a connection that looks correctly configured.
Studio Pro runs the resolution when you edit Module Settings. Headless, ask for it:
bash
mxcli sync-java-deps -p app.mpr # download into vendorlib/
mxcli sync-java-deps -p app.mpr --check # report what is missing, exit 1 (build gate)
mxcli run --local does this automatically for anything not already in
vendorlib/, so the warm loop works from a fresh clone. Dropping the jar into
userlib/ by hand works too — it is the same classpath — but then the model and
the file system disagree about where the dependency comes from.
'Redshift' and 'SQLServer' are not real values. Both appeared in an
earlier version of this table and neither is in the picker on any version
checked. mxcli writes the type string through unchanged and mxbuild does not
validate it — Type: 'Redshift' builds 0 errors and simply does not connect —
so mxcli check warns about an unrecognised type (MDL-DB01) rather than letting
a green build hide it.
Query Definition Syntax
A query is a child of the connection, with its properties in ( ):
Sql, Parameters, Returns and Map. The SQL may be a string or $$…$$,
which needs no quote doubling.
query QueryName (
Sql: 'SELECT * FROM table_name WHERE column = {paramName}',
Parameters: ( paramName: string ),
Returns: Module.EntityName
)
Query with Column Mapping
When database column names don't match entity attribute names, Map binds each
attribute to its column — Attribute = column, the way a mapping side is written:
Parameters can include a test value for Studio Pro testing, or indicate they should be tested with NULL:
sql
-- Test value (used in Studio Pro's Execute Query dialog)
Parameters: ( empName: string default 'Smith' )
-- Test with NULL value
Parameters: ( optionalDate: datetime null )
-- List all database connections
list database connections;
-- List connections in a specific module
list database connections in MyModule;
-- View connection source code
describe database connection MyModule.MyDatabase;
-- Remove one
drop database connection [if exists] MyModule.MyDatabase;
Best Practices
1. Connection String Management
Store JDBC URLs in constants for environment-specific overrides
Use MX_Module_ConstantName environment variables in production
2. Credential Security
Leave a password constant's default empty (DefaultValue: '') and set the value per environment; MDL has no private flag, and a trailing PRIVATE was never read
Never commit real passwords to version control
Inject credentials via CI/CD pipelines in production
3. Entity Design
Use NON-PERSISTENT entities for query results
Match attribute types to database column types
Use MAP clause when column names differ from attribute names
4. Query Design
Use parameterized queries to prevent SQL injection
Keep queries simple and focused
Create separate queries for different use cases
Troubleshooting
Connection Issues
Verify JDBC URL format for your database type
Check network connectivity to database host
Verify credentials are correct
Ensure JDBC driver is available
Query Issues
Test queries directly in database client first
Check parameter types match expected database types
Verify entity attributes match query result columns
Use MAP clause for column name mismatches
Related Commands
sql
-- Constants for configuration
create constant Module.Name ( Type: string, DefaultValue: 'value' );
list constants in module;
-- Non-persistent entities for results
create non-persistent entity Module.Name (...);
list entities in module;
Executing Queries from Microflows
Once a database connection and queries are defined, execute them from microflows using execute database query. The query is referenced by its 3-part qualified name: Module.Connection.Query.
Basic Syntax
sql
-- Execute a query and store results
$ResultList = execute database query Module.Connection.QueryName;
-- Fire-and-forget (no output variable)
execute database query Module.Connection.QueryName;
Dynamic SQL Override
Override the query's SQL at runtime using dynamic:
sql
$ResultList = execute database query Module.Connection.QueryName
dynamic 'SELECT id, name FROM employees WHERE active = true LIMIT 10';
A dynamic override still requires a value for every declared parameter —
including the ones the replacement SQL does not use. The parameter list belongs
to the query definition, not to the SQL string, so Mendix asks for all of them
whatever you substitute. Pass a placeholder for the unused ones:
sql
-- The definition declares $driverId; this SQL ignores it, and the call still
-- has to supply it.
$Count = execute database query F1.DuckDB.CountAllDrivers
dynamic 'SELECT count(*) AS n FROM read_csv(''/data/f1db-drivers.csv'')'
( driverId = 'unused' );
A {param} placeholder can be concatenated into a path, which is what keeps
absolute paths out of the model — bind the data directory as one constant and
build the file name around it:
sql
-- read_csv({dataDir} || '/f1db-drivers.csv')
Verified against DuckDB through the connector on Mendix 11.13, and against a
standalone JDBC harness before that.
Parameterized Queries
Pass values for the query parameters declared in the query's Parameters: list:
CRITICAL: Parameter names must exactly match those in the query definition (e.g., nation, not nationality). Mismatched names cause Studio Pro to regenerate mappings and clear values.
Runtime Connection Override
Override connection parameters at runtime using connection. Use case: multiple databases with the same schema but different data (e.g., region-specific databases).
Caveat: ConnectionParameterMappings require the database connection to have been tested/validated in Studio Pro first. Creating them programmatically may trigger "parameters have been updated" on first open.
Error Handling
execute database query only supports on error rollback (the default). on error continue is not supported for this action type.
Complete Example
sql
mdl 1;
-- Set up non-persistent entity, constants, and connection
create non-persistent entity HR.EmployeeRecord (
EmpId: integer,
Name: string(100),
Department: string(50)
);
create constant HR.DbUrl ( Type: string, DefaultValue: 'jdbc:postgresql://localhost:5432/hrdb' );
create constant HR.DbUser ( Type: string, DefaultValue: 'app' );
create constant HR.DbPass ( Type: string, DefaultValue: '' );
create database connection HR.MainDB (
Type: 'PostgreSQL',
ConnectionString: @HR.DbUrl,
Username: @HR.DbUser,
Password: @HR.DbPass
) {
query GetAllEmployees (
Sql: 'SELECT emp_id, name, department FROM employees',
Returns: HR.EmployeeRecord,
Map: (EmpId = emp_id, Name = name, Department = department)
)
query GetByDepartment (
Sql: 'SELECT emp_id, name, department FROM employees WHERE department = {dept}',
Parameters: ( dept: string ),
Returns: HR.EmployeeRecord,
Map: (EmpId = emp_id, Name = name, Department = department)
)
};
-- Microflow that executes the query
create microflow HR.ACT_LoadEmployees($Department: string)
returns list of HR.EmployeeRecord as $Employees
begin
$Employees = execute database query HR.MainDB.GetByDepartment
(dept = $Department);
return $Employees;
end;
Importing Data from External Databases
To bulk-import data from an external database directly into the Mendix app's PostgreSQL
database (bypassing the runtime), use import from instead of the Database Connector:
sql
mdl 1;
sql connect postgres 'postgres://user:pass@host:5432/legacydb' as source;
import from source query 'SELECT name, email FROM employees'
into HRModule.Employee
map (name as Name, email as Email);
See demo-data for details on the Mendix ID system and manual insertion.
Database Connections next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
Optimizes SQL queries and designs schemas using CTEs, window functions, covering indexes and EXPLAIN ANALYZE, with notes on dialect differences between major databases.
Push OData query options into the SQL of a Mendix resource served by a read microflow, so $filter, $orderby, $top, $skip, $count and the key lookup reach the database instead of being silently…
Chart a Mendix app with Vega-Lite through a pluggable widget that takes the specification and the data as separate properties, so the model emits rows and never assembles a chart payload.
Connect a Mendix app to an external database over JDBC with the External Database Connector, and define the queries microflows run against it. Database Connections is an agent skill from mendixlabs/mxcli. Connect a Mendix app to an external database over JDBC with the External Database Connector, and define the queries microflows run against it.
When should I use Database Connections?
Database Connections fits situations like: the app must read; SQL Server directly from a microflow.
How do I install Database Connections in Claude Code?
Run `npx skills add mendixlabs/mxcli --skill database-connections -a claude-code`. Or copy the skill folder (.claude/skills/mendix/database-connections in mendixlabs/mxcli) into .claude/skills/database-connections in your project. Claude Code loads it when a task matches its description.
How do I install Database Connections in Codex?
Run `npx skills add mendixlabs/mxcli --skill database-connections -a codex`. Or copy the skill folder (.claude/skills/mendix/database-connections in mendixlabs/mxcli) into .agents/skills/database-connections in your project. Codex loads it when a task matches its description.
Can I use Database Connections in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mendixlabs/mxcli --skill database-connections -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-connections, .gemini/skills/database-connections, .github/skills/database-connections and .opencode/skills/database-connections in your project.
What does Database Connections need to run?
SKILL.md names no scripts, command-line tools or credentials: Database Connections is instructions for the agent only.
Does Database Connections access the network?
SKILL.md names 1 domain. As links in the text: docs.mendix.com. This is read from the text; nothing was executed.
Is Database Connections safe to install?
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
What licence does Database Connections use?
Database Connections is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Database Connections use?
About 4.5k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
What are the alternatives to Database Connections?
Skills that share tags, products or a category with Database Connections: Database Migrations SQL Migrations (rmyndharis/antigravity-skills, 1.7k stars), SQL Pro (Jeffallan/claude-skills, 12k stars), SQL Optimization (github/awesome-copilot, 40k stars) and SQL Code Review (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Database Connections?
mendixlabs (a GitHub organization) maintains it in mendixlabs/mxcli, which has 128 GitHub stars. The repository holds 72 skills in this directory. The repository was last updated on October 7, 2026.
Source: mendixlabs/mxcli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.