8000 Write the compound files of VBA projects in one way, and each part of the DDL in a function of its own by dominion525 · Pull Request #139 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Write the compound files of VBA projects in one way, and each part of the DDL in a function of its own - #139

Merged
dominion525 merged 2 commits into
mainfrom
refactor/vba-and-ddl
Oct 26, 2026
Merged

dominion525 merged 2 commits into
mainfrom
refactor/vba-and-ddl

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • extract_vba_project_cfb (the Access 2000 format) and build_cfb_and_extract (later formats) each wrote a compound file in memory, with its storages first, its streams and a flush, and the same errors for each. They now write it with CfbWriter, and the entries of the VBA project are collected, read and written, and the type of a module told, in functions of their own.
  • generate_ddl writes the CREATE TABLE statements, the CREATE INDEX statements and the foreign keys in its three steps with a function each. generate_create_table writes the line of a column, the primary key and an inline foreign key in functions of their own, and generate_create_indexes tells which indexes get a statement and writes each in functions of their own.
  • The columns of a relationship are quoted and joined with quoted_columns, which the inline and the ALTER TABLE foreign keys and the note of a relationship without integrity share, rather than the same code in three places.
  • The DDL of the 120 databases of the test data in the four dialects, and their 196 VBA modules, are the same before and after, character for character. The errors and their messages are unchanged.
  • Functions above the thresholds: 64 → 58. Tests: 1115, as before. map_column_type of the four dialects is kept as the match over the column types.
Function Before (CC / Cog / SLOC) After, the function of the largest CC
vba extract_vba_project_cfb 25 / 11 / 79 8 / 2 / 17
vba build_cfb_and_extract 23 / 8 / 68 8 / 2 / 21
vba extract_modules_from_cfb 11 / 6 / 35 6 / 1 / 18
ddl generate_create_table 15 / 14 / 89 9 / 3 / 46
ddl generate_ddl 14 / 17 / 52 7 / 5 / 29
ddl generate_create_indexes 9 / 16 / 47 4 / 4 / 25

🤖 Generated with Claude Code

dominion525 and others added 2 commits October 26, 2026 13:46
… of their entries in functions of their own

- Write a compound file in memory with CfbWriter, whose methods create its storages and streams and finish it with the errors the two writers had each written
- Collect the entries of the VBA project of the Access 2000 format, read their streams and write them, and write the entries of later formats, in functions of their own
- Tell the type of a module in a function of its own

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… of a relationship joined in one place

- Write the CREATE TABLE statements, the line of a column, the primary key and an inline foreign key in functions of their own
- Tell which indexes get a CREATE INDEX statement, and write each, in functions of their own
- Quote and join the columns of a relationship with quoted_columns, which the foreign keys and the note of a relationship without integrity share

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Coverage

For b9a53e7.

Filename                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
jetdb-cli/src/export.rs            108                11    89.81%           5                 0   100.00%          66                 6    90.91%           0                 0         -
jetdb-cli/src/form.rs              254                24    90.55%          19                 5    73.68%         152                 9    94.08%           0                 0         -
jetdb-cli/src/macro_cmd.rs         151                11    92.72%          11                 2    81.82%          81                 5    93.83%           0                 0         -
jetdb-cli/src/main.rs              864                38    95.60%          70                 2    97.14%         549                25    95.45%           0                 0         -
jetdb-cli/src/prop.rs              308                15    95.13%          33                 2    93.94%         186                10    94.62%           0                 0         -
jetdb-cli/src/query.rs              80                 4    95.00%           5                 0   100.00%          51                 1    98.04%           0                 0         -
jetdb-cli/src/vba.rs                74                 4    94.59%           5                 0   100.00%          47                 1    97.87%           0                 0         -
jetdb-wasm/src/lib.rs             3871                95    97.55%         252                 4    98.41%        2031                22    98.92%           0                 0         -
jetdb/src/catalog.rs               509                14    97.25%          46                 0   100.00%         299                 3    99.00%           0                 0         -
jetdb/src/complex.rs               924                32    96.54%          73                 0   100.00%         605                15    97.52%           0                 0         -
jetdb/src/crypto.rs               2300               112    95.13%         127                10    92.13%        1315                60    95.44%           0                 0         -
jetdb/src/csv.rs                   857                24    97.20%          72                 0   100.00%         486                 6    98.77%           0                 0         -
jetdb/src/data.rs                 4560               179    96.07%         257                 3    98.83%        2564               110    95.71%           0                 0         -
jetdb/src/ddl/access.rs             70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/mod.rs              2771                 8    99.71%         208                 2    99.04%        1501                 6    99.60%           0                 0         -
jetdb/src/ddl/mysql.rs              70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/postgres.rs           71                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/sqlite.rs             69                 0   100.00%           7                 0   100.00%          48                 0   100.00%           0                 0         -
jetdb/src/encoding.rs              284                 0   100.00%          30                 0   100.00%         153                 0   100.00%           0                 0         -
jetdb/src/file.rs                 1915                65    96.61%         117                 0   100.00%         983                18    98.17%           0                 0     
A8AF
    -
jetdb/src/form.rs                 3123               128    95.90%         230                10    95.65%        1684                48    97.15%           0                 0         -
jetdb/src/form2000.rs              762                21    97.24%          56                 1    98.21%         402                 4    99.00%           0                 0         -
jetdb/src/format.rs                616                 2    99.68%          45                 0   100.00%         388                 2    99.48%           0                 0         -
jetdb/src/lib.rs                     3                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
jetdb/src/macro_action.rs          299                19    93.65%          27                 3    88.89%         165                24    85.45%           0                 0         -
jetdb/src/macro_def.rs            2440                88    96.39%         196                 9    95.41%        1596                36    97.74%           0                 0         -
jetdb/src/macro_text.rs            804                24    97.01%          54                 2    96.30%         451                20    95.57%           0                 0         -
jetdb/src/map.rs                   416                13    96.88%          27                 0   100.00%         221                 5    97.74%           0                 0         -
jetdb/src/money.rs                 281                 0   100.00%          26                 0   100.00%         186                 0   100.00%           0                 0         -
jetdb/src/prop.rs                 1375                18    98.69%          90                 0   100.00%         695                10    98.56%           0                 0         -
jetdb/src/query.rs                2514                62    97.53%         200                 1    99.50%        1550                18    98.84%           0                 0         -
jetdb/src/relationship.rs          249                26    89.56%          22                 0   100.00%         177                10    94.35%           0                 0         -
jetdb/src/save_as_text.rs          574                27    95.30%          52                 3    94.23%         341                27    92.08%           0                 0         -
jetdb/src/storage.rs               764                32    95.81%          57                 0   100.00%         434                 6    98.62%           0                 0         -
jetdb/src/table.rs                1679                67    96.01%         109                 2    98.17%        1017                18    98.23%           0                 0         -
jetdb/src/timestamp.rs             405                 0   100.00%          44                 0   100.00%         235                 0   100.00%           0                 0         -
jetdb/src/vba.rs                   649                57    91.22%          62                12    80.65%         354                23    93.50%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                            37063              1220    96.71%        2656                73    97.25%       21154               548    97.41%           0                 0         -

@dominion525
dominion525 merged commit 8cd5590 into main Oct 26, 2026
11 checks passed
@dominion525
dominion525 deleted the refactor/vba-and-ddl branch October 26, 2026 04:51
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