Skip to content

iOS: Insert Row cannot leave a column on its database default #2543

Description

@niklaswa

What happened?

Insert Row always writes every column into the INSERT. A field left empty is sent as
'', the NULL badge sends NULL. There is no way to omit a column and let the database
apply its default.

That makes a NOT NULL column with a default impossible to insert from the app. Example:

`created_at` datetime NOT NULL DEFAULT current_timestamp()
  • leaving the field empty sends '', which is not a valid datetime
  • tapping NULL sends NULL, which fails the constraint:
    MySQL query failed: Column 'created_at' cannot be null

The NULL badge is also offered on NOT NULL columns, where it can only ever fail.

Steps to reproduce

  1. Connect to MySQL.
  2. Open a table with a NOT NULL column that has a default (current_timestamp(), a
    literal, anything).
  3. Tap + to insert a row.
  4. Leave that column untouched, or tap its NULL badge.
  5. Save.

Expected behavior

A column the user has not filled in is left out of the statement, so the database applies
its default. NULL stays available for nullable columns only.

Database type

MySQL / MariaDB

TablePro version

1.0 (Build 19)

macOS version & chip

iOS 27

Screenshots / Logs

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions