Skip to content

MariaDB: offer a value picker for a column CHECK (col IN (...)) #4424

Done

Description

@datlechin

Problem

A MariaDB column with CHECK (status IN ('new','paid')) gets no value picker in the grid, no value completion and no allowed_values in MCP describe_table. The same check on SQLite gives a grid picker.

The app's fallback reads the table DDL and matches CHECK ("col" IN (...)) (apple/TablePro/Core/Services/Query/QuerySqlParser.swift:107-122, apple/TablePro/Views/Main/MainContentCoordinator.swift:1199-1228). MariaDB prints backticks, CHECK (`status` in ('new','paid')), so it never matches outside ANSI_QUOTES.

Proposed solution

The MariaDB driver already reads each column's own CHECK clause from INFORMATION_SCHEMA.CHECK_CONSTRAINTS into columnCheck (apple/Plugins/MySQLDriverPlugin/MySQLPluginDriver+Schema.swift:123-127, MySQLColumnChecks.swift:193-231), but fills allowedValues only from ENUM and SET (MySQLPluginDriver+Schema.swift:118). When the whole clause is `col` IN ('a', 'b', ...) with string literals only, set allowedValues from it. The grid picker, completion, MCP describe_table and Generate Rows already read allowedValues (apple/TablePro/Core/Plugins/PluginObjectMapping.swift:26).

Table-level checks (LEVEL = 'Table') and MySQL 8, which writes CHECK ((`status` in (_utf8mb4'new',_utf8mb4'paid'))), could follow.

Alternatives considered

Teach the app's DDL regex backticks. That keeps a DDL read on every table open and parses engine syntax in the app.

Platform

macOS

Related database type

MySQL / MariaDB

Found during the 2026-11-22 perf audit.

Activity

  1. added
    enhancement
    platform-macos
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions