Question: How to use SQLite?
Xitee1 opened this issue ยท 3 comments
I saw that with the latest update, SQLite support was added. But how to use it? There is no storage file for it or similar. Also I couldn't find a description in the documentation.
The documentation for this is still missing, i am working on that ^^
Here is a short explanation:
- Download the
sqlite-jdbc-3.42.0.0.jar
(or any other recent version) from somewhere, e.g. here and place it in the./bluemap
folder. - Go to your
storages/sql.conf
and configure it like this:
...
# The JDBC-Connection URL that is used to connect to the database.
# The format for this url is: jdbc:[driver]://[host]:[port]/[database]
#connection-url: "jdbc:mysql://localhost/bluemap?permitMysqlScheme&user=root"
connection-url: "jdbc:sqlite:bluemap/sqlite.db"
# This can be used to load a custom jdbc-driver from a .jar file.
# E.g. if your runtime-environment is not already providing the sql-driver you need,
# you could download the MariaDB JDBC-Connector from https://mariadb.com/downloads/connectors/connectors-data-access/java8-connector/
# place it in the './bluemap' folder and use is like this:
driver-jar: "bluemap/sqlite-jdbc-3.42.0.0.jar"
# This is the driver-class that bluemap will try to load and use.
# Check the documentation of the driver you are using if you don't know this.
# Leaving this commented means that bluemap automatically tries to find a suitable driver in your classpath.
# (If you added a custom driverJar above, you HAVE TO set the correct class name here)
driver-class: "org.sqlite.JDBC"
# The maximum number of connections to the database that are allowed to be open at the same time.
# A negative number means unlimited.
# Default is: -1
max-connections: 1
...
- change the
storage: "file"
in each of your map-configs tostorage: "sql"
That should be all :)
If you have further questions, please use our discord! :)
Here is now the promised Wiki-Entry: https://bluemap.bluecolored.de/wiki/customization/Storages.html#sqlite
:)