HubTou / mod_storage

A Luanti tool for managing the mod_storage SQLite3 database file content.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mod_storage manager

A Luanti tool for managing the mod_storage SQLite3 database file content.

With it you can view the database entries, insert entries, delete an entry or delete all entries by modname or key.

Installation

  1. Install Python,
  2. Copy the mod_storage.py script somewhere in your computer:
    1. Preferably somewhere in the PATH,
    2. Or in your luanti/client directory, where the mod_storage.sqlite file is located.

Note: If you haven't upgraded yet to luanti 5.10.0 or newer, your luanti directory will be called minetest...

Usage

This is a command-line tool.

If you use Windows, run it through your Terminal or your PowerShell application. If your terminal opens a new window and doesn't give you a chance to see what is printed inside, just type the following command before trying anew:

$env:PATHEXT += ';.PY'

To obtain usage help, type one of the following commands:

mod_storage --help
mod_storage -?

If you don't run the script in the place where your mod_storage.sqlite file is located, you'll need to indicate its path with the -d, --db or --database option.

To view the database content, type one of the following commands:

mod_storage
mod_storage view

To insert an entry, use the following command:

mod_storage --modname "My mod name" --key "The key" --value "The corresponding value" insert

You can replace:

  • --modname by the shorter --mod or -m
  • --key by the shorter -k
  • --value by the shorter --val or -v

If the parameter is only one word, you don't have to quote it.

To delete entries, type one of the following commands:

mod_storage --modname "My mod name" --key "The key" delete
mod_storage --modname "My mod name" delete
mod_storage --key "The key" delete

The first form will delete the specified entry, the second one all entries for MODNAME and the last one all entries for KEY.

If you are unsure of what you're doing, just make a copy of your *mod_storage.sqlite" file before starting to edit it...

Caveats

Processing of other backend storage methods is not supported.

Possible future directions

This command was made to clean up my mod_storage file after playing too much with work-in-progress mods.

And I especially wanted to test the possibility to communicate with a client-side mod through this file... => It works! Two way communication between Luanti and an external program is possible through mod_storage.sqlite

Given this result, it would now be interesting to offer a batch mechanism to import/export file contents into/from mod_storage.

Go to Discussions if you want to suggest other things...

About

A Luanti tool for managing the mod_storage SQLite3 database file content.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%