OpenMSX + Sqlite ^_^

Por andrear1979

Expert (93)

imagem de andrear1979

03-03-2015, 21:32

Hi guys, I just wanted to share this information, you may already know it but I've never seen it mentioned.

The TCL interpreter of OpenMSX supports sqlite database out of the box (i.e. no need to recompile sources), via "TCL extensions".

Possible applications:

  • exotic logging procedures
  • interaction with old MSX database applications ("let's port that old 1984 address book data to sqlite")
  • (other suggestions welcome)

I tested it on my Win7 and it works!

(warning: in the next section I assume you know how to compile with MinGW, how to use the sqlite shell (sqlite3.exe) and how to create a sqlite test database with it)

Here's what I did to test:

  • I didn't find binaries of the TCL extension, so I built it from sources: I downloaded latest tcl sources and compiled them with MSYS+MinGW (sh configure ; make), the extension "sqlite3837.dll" was generated in folder ...mytclsources.../win/pkgs/sqlite3.8.7.1/
  • I read documentation about tclsqliteand how to load a TCL extension
  • I put sqlite3871.dll and andrea01.sqlite3 (a simple test database made by me with sqlite3.exe) in the same folder of openmsx.exe (or catapult.exe if you use it)
  • I loaded the extension and printed results of a SQL SELECT statement: see the screenshot

Hope it may stimulate curiosity and new experiments among the OpenMSX scripters around the world :-)

Kindest regards,

Andrea

Entrar ou registrar-se para comentar

Por Manuel

Ascended (15684)

imagem de Manuel

03-03-2015, 21:54

Yes, openMSX contains a full Tcl interpreter, it will support anything that a Tcl interpreter supports, including this particular library.

I'm very interested to read/see what you guys create with openMSX's scripting power!

Also, don't hesitate to submit scripts to us, so we can include them in the official openMSX distribution!