You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sno init --import and sno import handle only one table at a time. To import a whole database you have to run sno import multiple times. We can improve this.
Background
#83 changed the import command semantics a little, adding the --table={table} flag.
While we could just make that flag usable multiple times (--table=table1 --table=table2) it feels clunky, makes it hard to apply arguments with tools like xargs, etc.
A better pattern would be sno import {source} table1 [table2...].
However we also have some existing positional arguments, which would make this approach ambiguous:
in sno import, an existing positional argument (confusingly named DIRECTORY in the usage text) which is the imported name of the table. This allows the user to rename tables as they import.
in sno init, a separate thing also called DIRECTORY, which is the directory where the repo should be initialised. This is the same as the git init argument of the same name.
Proposal
change --table=TABLE and turn it into a positional argument with multiple values allowed.
To allow for renaming tables during import, use something like tablename:newtablename or tablename@newtablename. This removes the need for the DIRECTORY argument to sno import, so we can remove that.
Import all tables from a source with an --all-tables flag. If --all-tables is given, don't support renaming.
Turn the DIRECTORY arg of sno init into a --path DIRECTORY option.
The text was updated successfully, but these errors were encountered:
sno init --import
andsno import
handle only one table at a time. To import a whole database you have to runsno import
multiple times. We can improve this.Background
#83 changed the import command semantics a little, adding the
--table={table}
flag.While we could just make that flag usable multiple times (
--table=table1 --table=table2
) it feels clunky, makes it hard to apply arguments with tools likexargs
, etc.A better pattern would be
sno import {source} table1 [table2...]
.However we also have some existing positional arguments, which would make this approach ambiguous:
sno import
, an existing positional argument (confusingly namedDIRECTORY
in the usage text) which is the imported name of the table. This allows the user to rename tables as they import.sno init
, a separate thing also calledDIRECTORY
, which is the directory where the repo should be initialised. This is the same as thegit init
argument of the same name.Proposal
--table=TABLE
and turn it into a positional argument with multiple values allowed.tablename:newtablename
ortablename@newtablename
. This removes the need for theDIRECTORY
argument tosno import
, so we can remove that.--all-tables
flag. If--all-tables
is given, don't support renaming.DIRECTORY
arg ofsno init
into a--path DIRECTORY
option.The text was updated successfully, but these errors were encountered: