8000 Keep the rules the CLI and jetdb-wasm share in the library by dominion525 · Pull Request #40 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Keep the rules the CLI and jetdb-wasm share in the library - #40

Merged
dominion525 merged 7 commits into
mainfrom
refactor/shared-rules
Oct 1, 2026
Merged

dominion525 merged 7 commits into
mainfrom
refactor/shared-rules

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • The CLI and jetdb-wasm each carried their own copy of the same rules, so fixing one could leave the other behind. Each rule now lives in the library and both call it; the behavior does not change.
    • JetVersion::short_name: the short version names (JET3 to ACE17)
    • CatalogEntry::is_system and is_system_or_hidden: which catalog entries are system or hidden objects, also used by table_names
    • catalog::find_table: a table by name, or TableNotFound
    • ColumnDef::is_shown: which columns export and jetdb-wasm show by default
    • timestamp::format_default with DEFAULT_DATE_FORMAT and DEFAULT_DATETIME_FORMAT: a timestamp as export writes it by default
  • The column flag 0x10 was named column_flags::REPLICATION, with is_replication_column, but it marks the columns Access maintains and hides, such as every column of a system table. Add column_flags::HIDDEN and ColumnDef::is_hidden, and keep the former names, with the same value and answer, as deprecated. The help of export --system-columns and docs/cli.md / docs/cli.ja.md now describe these columns the same way.
  • The tests of these rules move to the library, next to the rules.

🤖 Generated with Claude Code

dominion525 and others added 7 commits October 1, 2026 20:26
- The CLI and jetdb-wasm each had the same table from JetVersion to its short name (JET3, JET4, ACE12 to ACE17)
- Add JetVersion::short_name to the library, use it from both, and move the test of the names from the CLI to the library

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The library, the CLI and jetdb-wasm each tested the system and hidden flags of a catalog entry themselves, in seven places
- Add CatalogEntry::is_system and CatalogEntry::is_system_or_hidden, and use them everywhere the flags were tested; the test that checks the flag of MSysObjects itself is unchanged

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- jetdb export, jetdb schema and jetdb-wasm each searched the catalog for a table of a given name and returned TableNotFound when there was none
- Add find_table to the library and use it in all three; the data macros of a table are still found by their own search, as they are read from the raw MSysObjects rows rather than the catalog

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- column_flags::REPLICATION and is_replication_column were named for replication, but the flag marks every column Access maintains and hides from users, such as every column of a system table
- Add column_flags::HIDDEN and ColumnDef::is_hidden, and use them in the CLI and jetdb-wasm
- Keep REPLICATION and is_replication_column, with the same value and answer, as deprecated, so that code using them still compiles with a warning

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- jetdb export and jetdb-wasm each decided which columns to show the same way: hidden columns are left out, except in a system table, where every column is hidden
- Add ColumnDef::is_shown to the library and use it in both; export still shows every column with --system-columns
- Move the test of the rule from jetdb-wasm to the library

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- jetdb export, jetdb prop and jetdb-wasm each spelled out the default formats, the date alone at midnight and the date and time otherwise
- Add DEFAULT_DATE_FORMAT, DEFAULT_DATETIME_FORMAT and format_default to the timestamp module, and use them for the defaults of export's --date-format and --datetime-format, in prop, and in jetdb-wasm

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The help and docs called the columns that export leaves out by default replication system columns, but they are the columns Access maintains and hides, as column_flags::HIDDEN is now named
- Reword the help of --system-columns and the export sections of docs/cli.md and docs/cli.ja.md; the option itself is unchanged

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dominion525
dominion525 merged commit 01ed274 into main Oct 1, 2026
10 checks passed
@dominion525
dominion525 deleted the refactor/shared-rules branch October 1, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0