Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overwrite command #247

Merged
merged 39 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a50176e
Add boilerplate for overwrite command
CobbCoding1 Oct 24, 2024
5770416
Add more boilerplate for overwrite and update help.c message
CobbCoding1 Oct 25, 2024
7aca16e
Prepare overwrite implementation
CobbCoding1 Oct 25, 2024
31e3b89
Setup sqlite in overwrite.c and add parsing for non-flag arguments
CobbCoding1 Oct 25, 2024
c2412a6
Add sqlite initialization functions to overwrite, and messages for ce…
CobbCoding1 Oct 26, 2024
fdc5315
Add simple test for overwrite
CobbCoding1 Oct 26, 2024
52fa9a5
clang-format
CobbCoding1 Oct 26, 2024
734cddb
Add `overwrite` command skeleton and initialization (#241)
CobbCoding1 Oct 26, 2024
4b6aa33
Add improved testing for overwrite command
CobbCoding1 Oct 26, 2024
34cbd79
Update usage and tests to reflect the usage
CobbCoding1 Oct 26, 2024
8d350f2
merge changes
CobbCoding1 Oct 26, 2024
2403e6e
Fix test makefile
CobbCoding1 Oct 26, 2024
416215c
Update `overwrite` tests and usage. (#243)
CobbCoding1 Oct 26, 2024
bf05639
Update sqlite3_open_v2 to be readonly unless necessary
CobbCoding1 Oct 27, 2024
93ec5ce
Update arg parsing for some of the new arguments and options
CobbCoding1 Oct 27, 2024
75303fb
Implement clear command (untested so far)
CobbCoding1 Oct 27, 2024
8b00c55
merge
CobbCoding1 Oct 27, 2024
8237961
Add insert command
CobbCoding1 Oct 27, 2024
fb6659f
Update row and column parsing to use new format
CobbCoding1 Oct 27, 2024
5e80735
Update tests and prepare overwrite file
CobbCoding1 Oct 28, 2024
321c06d
Update overwrite to integrate better with existing overwrite infastru…
CobbCoding1 Oct 28, 2024
b629df6
Update test and add length to output when listing overwrites
CobbCoding1 Oct 28, 2024
8db9195
clang-format
CobbCoding1 Oct 28, 2024
6fb667b
remove commented code
CobbCoding1 Oct 28, 2024
8e54a3c
Add error message to failed init
CobbCoding1 Oct 29, 2024
06d669e
add check for if an overwrite already exists at selected row and colu…
CobbCoding1 Oct 29, 2024
0ffddbd
clang format
CobbCoding1 Oct 29, 2024
f7140e3
fix build error
CobbCoding1 Oct 29, 2024
8ce138e
Fix test Makefile issue
CobbCoding1 Oct 29, 2024
8ee9bef
Update zsvext-test to reflect the usage changes
CobbCoding1 Oct 29, 2024
d949294
Add timestamp and author fields, and update the tests accordingly
CobbCoding1 Oct 30, 2024
7395edc
Clang format
CobbCoding1 Oct 30, 2024
1af3f75
Update overwrite help message, change position to overwrites_uix, add…
CobbCoding1 Oct 31, 2024
c9c3766
Run clang-format
CobbCoding1 Oct 31, 2024
ceed2a6
Add header to overwrite list output
CobbCoding1 Nov 1, 2024
3bc4fb5
Update to support Excel-style cells
CobbCoding1 Nov 5, 2024
3d1f9b5
clang format
CobbCoding1 Nov 5, 2024
77890b3
update parse_xl_address to be more universal
CobbCoding1 Nov 5, 2024
2aa20ad
Update Makefile
liquidaty Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ endif

ZSV=$(BINDIR)/zsv${EXE}

SOURCES=echo paste count count-pull select select-pull 2tsv 2json serialize flatten pretty stack desc sql 2db compare prop rm mv jq
CLI_SOURCES=echo select desc count paste 2tsv pretty sql flatten 2json serialize stack 2db compare prop rm mv jq
SOURCES=echo paste count count-pull select select-pull 2tsv 2json serialize flatten pretty stack desc sql 2db compare prop rm mv jq overwrite
CLI_SOURCES=echo select desc count paste 2tsv pretty sql flatten 2json serialize stack 2db compare prop rm mv jq overwrite

ifeq ($(ZSVSHEET_BUILD),1)
SOURCES+=sheet
Expand Down Expand Up @@ -290,7 +290,7 @@ help:
@echo "which will build and test all apps, or to build/test a single app:"
@echo " ${MAKE} test-xx"
@echo "where xx is any of:"
@echo " echo count count-pull paste select select-pull 2tsv 2json serialize flatten pretty stack desc sql 2db prop rm mv"
@echo " echo count count-pull paste select select-pull 2tsv 2json serialize flatten pretty stack desc sql 2db prop rm mv overwrite"
@echo ""

install: ${ZSV}
Expand Down
1 change: 1 addition & 0 deletions app/builtin/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static int main_help(int argc, const char *argv[]) {
"Commands that parse CSV or other tabular data:",
" select : extract rows/columns by name or position and perform other basic and 'cleanup' operations",
" echo : write tabular input to stdout with optional cell overwrites",
" overwrite: save, modify or apply overwrites",
" sql : run ad-hoc SQL",
" count : print the number of rows",
" desc : describe each column",
Expand Down
2 changes: 2 additions & 0 deletions app/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ ZSV_MAIN_DECL(compare);
ZSV_MAIN_DECL(sheet);
#endif
ZSV_MAIN_DECL(echo);
ZSV_MAIN_DECL(overwrite);
ZSV_MAIN_NO_OPTIONS_DECL(prop);
ZSV_MAIN_NO_OPTIONS_DECL(rm);
ZSV_MAIN_NO_OPTIONS_DECL(mv);
Expand Down Expand Up @@ -123,6 +124,7 @@ struct builtin_cmd builtin_cmds[] = {
CLI_BUILTIN_COMMANDEXT(sheet),
#endif
CLI_BUILTIN_COMMAND(echo),
CLI_BUILTIN_COMMAND(overwrite),
CLI_BUILTIN_NO_OPTIONS_COMMAND(prop),
CLI_BUILTIN_NO_OPTIONS_COMMAND(rm),
CLI_BUILTIN_NO_OPTIONS_COMMAND(mv),
Expand Down
2 changes: 2 additions & 0 deletions app/ext_example/test/expected/zsvext-test-3.out
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Options common to all commands except `prop`, `rm` and `jq`:
Commands that parse CSV or other tabular data:
select : extract rows/columns by name or position and perform other basic and 'cleanup' operations
echo : write tabular input to stdout with optional cell overwrites
overwrite: save, modify or apply overwrites
sql : run ad-hoc SQL
count : print the number of rows
desc : describe each column
Expand Down Expand Up @@ -95,6 +96,7 @@ Options common to all commands except `prop`, `rm` and `jq`:
Commands that parse CSV or other tabular data:
select : extract rows/columns by name or position and perform other basic and 'cleanup' operations
echo : write tabular input to stdout with optional cell overwrites
overwrite: save, modify or apply overwrites
sql : run ad-hoc SQL
count : print the number of rows
desc : describe each column
Expand Down
Loading