19

If I have a script that handles state information that's a bit more complex that can be stored in variables, what's the best option for a small in-memory database?

Sqlite is an option, though that would be an external dependency. XML might do, though it's non-relational.

Is there any consensus on a tool for this job?

JSacksteder
  • 780
  • 2
  • 7
  • 21

4 Answers4

11

Considering PowerShell's great support for scripting .NET, how about using an ADO.NET DataSet.

Keith Hill
  • 194,368
  • 42
  • 353
  • 369
  • May be you now any attempt to provide SQL interface above DataSet to add tables and rows into it? Right now it is object oriented. Search for this type of project failed cause of other meaning for keywords involved. – Dzmitry Lahoda Feb 04 '15 at 12:08
  • I't is an exclente solution as a local database... and it is more productive and efficient to work with Objects or LINQ than using SQL... – ZEE Dec 11 '19 at 12:47
1

For small data ( less then few GBs ) you can use a RAM disk, and use any usual storage ( SQ DB, NoSQL DB, or even a text file), to store data, as usual.

TPAKTOPA
  • 2,462
  • 1
  • 19
  • 26
1

Now in memory database is available in Microsoft.Data.Sqlite:

https://learn.microsoft.com/en-us/dotnet/standard/data/sqlite/in-memory-databases

pinturic
  • 2,253
  • 1
  • 17
  • 34
0

If you need to persist the data across session, consider using SQL Server Compact Edition. I have used it for a number of smallish .NET projects and it generally works like a small, single user SQL Server.

http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx

Goyuix
  • 23,614
  • 14
  • 84
  • 128