spine-tools / Spine-Database-API

Database interface to Spine generic data model
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
6 stars 5 forks source link

SpineDBServer as standalone application #431

Open soininen opened 4 months ago

soininen commented 4 months ago

SpineDBServer is a socket server that can be used to communicate with spinedb_api over a network socket. When using the server, client processes can access Spine data without the need to call Python. Most notably, SpineInterface does not need PyCall when accessing Spine data via the server.

Toolbox sets up the server for Julia Tools such as SpineOpt automatically. However, when running SpineOpt outside of Toolbox e.g. for development purposes, PyCall is required and it is notoriously difficult to set up. If it was possible to start SpineDBServer as a standalone server, SpineOpt users would not need to use PyCall even in this situation.

We could add an entry point to spinedb_api that starts SpineDBServer process. It should accept a database URL, network port and filter settings as command line arguments. You could then start the server manually or add suitable commands to e.g. run_spineopt.jl script to establish a connection.