Menu

Git Code Merge Request #56: Add batch mode (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

albfan wants to merge 1 commit from /u/albfan/ucanaccess/ to master, 2020-02-19

Allow command line to work non interactively.

console.sh <accessdb-file> [password] [command]</accessdb-file>

For example you can do:

console.sh mydatabase.accdb export -t users users.csv

See password is only used if is needed (I think a proper command line would be better but I prefer to start small)

About:

console.sh mydatabase.accdb

It allows to start console without first user input (which seems pretty convenient). Again I would look for the file in current workdir, but prefer to ask for review before continue

Commit Date  
[5e947f] (command-line) by Alberto Fanjul Alberto Fanjul

Add command line batch mode

Allow to load a database and execute commands automatically

2020-02-13 15:37:06 Tree

Discussion

  • albfan

    albfan - 2020-02-13

    I pushed another commits to MR.

    • modifications to accept command line arguments in console.sh
    • Simplification of SingleValue object output. So columns with array of this shows as: [1, 2] instead of [ SingleValue [value=1], SingleValue [value=2]]

    I'm turning the csv to json to import into mongodb, and just need to process the result with:

    csvjson data.csv | jq . > data,json
    sed 's/"[]"/null/g' data.json > data_sin_empty_array.json
    sed 's/"([.*])"/\1/g' data_sin_empty_array.json > data_array.json

    to have a json formatted, with empty arrays turn into null, and strings "[1,2]" turn into [1,2] (real arrays in json.

    I would add json if that is interesting

    About this SingleValue multi array columns, I cannot see the relation (it is a foreign key with other tables) in the console.sh output, is there any missing feature to show that? Right now I'm guessing the relationship by the column name and tables. column users_id should be related with users (etc...)

     
  • albfan

    albfan - 2020-02-13

    I pushed another commits to MR.

    • modifications to accept command line arguments in console.sh
    • Simplification of SingleValue object output. So columns with array of this shows as: [1, 2] instead of [ SingleValue [value=1], SingleValue [value=2]]

    I'm turning the csv to json to import into mongodb, and just need to process the result with:

    csvjson data.csv | jq . > data,json
    sed 's/"[]"/null/g' data.json > data_sin_empty_array.json
    sed 's/"([.*])"/\1/g' data_sin_empty_array.json > data_array.json

    to have a json formatted, with empty arrays turn into null, and strings "[1,2]" turn into [1,2] (real arrays in json.

    I would add json if that is interesting

    About this SingleValue multi array columns, I cannot see the relation (it is a foreign key with other tables) in the console.sh output, is there any missing feature to show that? Right now I'm guessing the relationship by the column name and tables. column users_id should be related with users (etc...)

     
  • albfan

    albfan - 2020-02-14

    Just added relatie paths, to avoid absolute paths to locate a file

     
  • Marco Amadei

    Marco Amadei - 2020-02-19
    • Status: open --> merged
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.