COOPY » Guide
version 0.6.5
|
Modify a table/database/spreadsheet to integrate the changes described in a pre-computed difference.
--act=ACT
filter for an action of a particular type (update, insert, delete, none, schema)
--cmd=CMD
specify an action inline in tdiff format
--default-table=TABLE
name to use when a table name is needed and not supplied
--help
show how to use this program
--inplace
if modifications are made, make them in place without a copy
--input-formats
list supported input database formats
--neither
in case of conflict use cell value from common ancestor
--ours
in case of conflict use cell value that was the local choice
--output=OUTPUTFILE
direct output to this file (default is standard output)
--patch-formats
list supported patch formats
--table=TABLE
filter for a named table of a workbook/database (repeat option for multiple tables)
--theirs
in case of conflict use cell value that wasn't the local choice
You can generate test file(s) for the examples that follow:
sspatch --test-file directory.sqlite sspatch --test-file numbers.csv sspatch --test-file numbers_buggy.csv sspatch --test-file numbers_buggy.sqlite
sspatch numbers_buggy.csv numbers_patch.tdiff
Apply a patch to a table. Output goes to standard output. Input file is untouched.
sspatch --inplace numbers_buggy.csv numbers_patch.tdiff
Apply a patch to a table. Input file is modified.
sspatch --tmp tmp.sqlite numbers_buggy.sqlite numbers_patch.tdiff
Apply a patch to a sqlite database. Input file is not modified. Space for a temporary database is needed to do this. If not supplied, sspatch will ask for it.
sspatch - numbers_patch.tdiff < numbers_buggy.csv
Apply a patch to a table read from standard input.
sspatch numbers_buggy.csv - < numbers_patch.tdiff
Apply a patch read from standard input.
sspatch --cmd "+ |two|2|" numbers_buggy.csv
Add a new row to a table.
sspatch --cmd "- |NAME=four|" numbers.csv
Remove a row from a table
sspatch --cmd "= |NAME=four|DIGIT:*->4|" numbers_buggy.csv
Change the DIGIT column on a row with NAME=four.
sspatch --inplace --table organizations \ --cmd "+ |42|The New Organization|" directory.sqlite
Add an organization. The specified organization ID is replaced by an autoincremented ID generated by sqlite. Use 'ssformat directory.sqlite' to view result.
sspatch --native --inplace --table organizations \ --cmd "+ |42|The New Organization|" directory.sqlite
Add an organization. The specified organization ID is used (due to --native flag). Use 'ssformat directory.sqlite' to view result.
CSV: plain-text delimiter-separated family of formats
SQLITE: file-based database
SQLITEXT: sqlite-format sql dump
JSONBOOK: Spreadsheet formats in json
GNUMERIC: Spreadsheet formats (via gnumeric)
MDB: Access database format (via Mdbtools, READ-ONLY)
JMDB: Access database format (via Jackcess)
MYSQL: database connector
SOCIALCALC: SocialCalc format (via mozjs)
sspatch version 0.6.5