By Cyral on Sunday, November 15th 2015
Bricklayer supports multiple SQL database providers. SQLite and MySQL libraries are shipped with Bricklayer by default. SQLite is the default provider as it requires no setup. You may change the connection string and provider in your server's
config.json. For example, you may want to use MySQL so you can externally connect to the database or use it to display statistics on your website.
To use SQlite or MySQL, use the relevant JSON below in the "Database" section of the config.
"Connection": "Data Source = database.sqlite;", "Provider": "Mono.Data.Sqlite"
"Connection": "Server=localhost;Database=bricklayer;Uid=myUsername;Pwd=myPassword;", "Provider": "MySql.Data.MySqlClient"
Note that you must create the "bricklayer" database.
While SQLite and MySQL are the only officially supported providers, it is theoretically possible to use any database that conforms to the same SQL synax by using the following steps:
- Place the provider's .dll into the server directory. You must use assemblies compatible with .NET.
- Add the provider to Bricklayer Server.exe.config. You will see examples for MySQL and SQLite in this file.
- Modify the provider in your server's config to use the invariant name of the provider in the exe's config. (e.g. for MySQL, use "MySql.Data.MySqlClient")
- Choose an appropriate connection string.