V4 beta Feb-9-2018 available now

 From:  Michael Gibson
8814.45 In reply to 8814.43 
Hi Marco,

> 1) If I decide to use SQLite, can I access it directly from Moi's scripts/command ?

MoI does not currently have anything specifically set up to use SQLite from scripts but it might be possible to write out text files with SQL statements using moi.filesystem.openFileStream() and then invoke the sqlite binary to read them using moi.filesystem.shellExecute().


> Is this solution good for both WIndows/Mac version of Moi ?

It might be - Mac has a version of sqlite built in, for Windows it would need to be deployed.


> What I want to say is : if I decide to write a plugin that should manage a SqlLite database inside
> some commands/script written for Moi V4, can I "write once - run everywhere" ? Here for
> "everywhere" I mean both Windows and Mac version of Moi.
> Or for example, if I want to access a SQLite db from within a Moi script, I must run Moi in
> admin mode on Windows or do other kind of "trick" on Mac ?

I'm not sure of the answers for these questions, it would probably take some experimentation and testing to determine these things.


> 2) SQLite or not, I think that at least I could work on a bunch of JSON files, used
> for storing all the data that I want to manage.
> Same thoughts like question 1. In this case "write once - run everywhere" ?

You can write a text file with cross platform support by using moi.filesystem.openFileStream(). There may be operating system
specific limits on where you can place them though, for example Windows restricts writing to the Program Files directory
unless the program is run with elevated privileges.

- Michael