0

From Linux, might there be a "native" or built-in convenient "database" facility from withing Powershell itself?

While this works fine for importing data:

nicholas@mordor:~/csv$ 
nicholas@mordor:~/csv$ ll BCCDC_COVID19_Dashboard_Lab_Information.csv 
-rw-rw-r-- 1 nicholas nicholas 89153 Nov 22 05:16 BCCDC_COVID19_Dashboard_Lab_Information.csv
nicholas@mordor:~/csv$ 
nicholas@mordor:~/csv$ pwsh
PowerShell 7.1.0
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/nicholas/csv> 
PS /home/nicholas/csv> $labs=import-Csv labs.csv
PS /home/nicholas/csv> 

this was just so surprisingly simple and gives such at least human readable results:

..
Date        : 2020-11-19
Region      : Vancouver Coastal
New_Tests   : 2923
Total_Tests : 337615
Positivity  : 5.12
Turn_Around : 28.5

Date        : 2020-11-19
Region      : Vancouver Island
New_Tests   : 1682
Total_Tests : 118623
Positivity  : 1.4
Turn_Around : 12.7


PS /home/nicholas/csv> 

perhaps there's a utility even "lighter" than SQLite.

Using Linux, aside from persisting to a mainstream RDBMS such as:

  • MySQL
  • Postgres
  • SQLite

how else might data such as this be persisted?

I'm more interested in retrieving such data.

  • 2
    Please (re)phrase your actual question. As you answer yourself: "*`Import-Csv`, this was just so surprisingly simple and gives such at least human readable results*", so why not using that? (I can think of a few reasons, but ***you*** need to define them in your question, to get a proper answer). – iRon Nov 23 '20 at 10:26
  • I updated the question to, hopefully, address your critique. – Nicholas Saunders Nov 23 '20 at 12:40
  • 2
    Does it need to be a database? Or is a serialized object stored in file also sufficient? Again: **explain why a *surprisingly simple* `csv` file doesn't (completely) fulfill your needs?** – iRon Nov 23 '20 at 13:20
  • 1
    Yeah I have a hard time seeing what the problem is. If the CSV works perfectly as is, what's the question? Just keep it as a CSV then... – PMental Nov 23 '20 at 20:42
  • I was more interested in persistence, and was looking at `New-PSDrive` -- but that turns out to be impractical for `Linux`. Given that `MSSQL` isn't a realistic (?) option either. Not sure what my choices are for storage. – Nicholas Saunders Nov 24 '20 at 01:49

0 Answers0