Add duplicate row and insert current time via context menu#159
Merged
debba merged 2 commits intoTabularisDB:mainfrom May 4, 2026
Merged
Conversation
Resolve conflicts in src/components/ui/DataGrid.tsx and src/pages/Editor.tsx by combining the duplicate-row / insert-server-now context menu items from this branch with the multi-row deletion support added on main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"Duplicate Row" creates a new pending insertion pre-filled with all values from the source row.
Auto-increment / serial columns are cleared so the database generates a fresh key on commit.
DATE,TIME,DATETIME,TIMESTAMP(or equivalent) column shows a new "Insert Current Timestamp" option thatfetches the current date/time from the database server (not the client) and writes it into
the cell, formatted to match the column type.
Changes
Backend
get_server_now(connection_id)incommands.rs— executesSELECT NOW()for MySQL/PostgreSQL and
SELECT datetime('now', 'localtime')for SQLite, returning the rawtimestamp string.
lib.rs.Frontend
DataGrid.tsx:duplicateSelectedRowcallback copies row data (existing or pending insertion)and calls the new
onDuplicateRowprop.setCellServerNowcallback invokesget_server_now,parses the result with
parseDateTime, and formats it viaformatDateTimeto match the column'sdate mode before writing through
onPendingChange/onPendingInsertionChange. The "InsertCurrent Timestamp" menu item is only shown when the right-clicked column resolves to a date/time
type.
Editor.tsx:handleDuplicateRowcreates a new pending insertion from the provided row data(auto-increment columns nulled out). Prop wired into
<DataGrid>.