Anope IRC Services

Anope Support => 2.0.x/1.9.x Support => Topic started by: CrazyCat on September 18, 2019, 10:09:29 PM

Title: m_sql_authentication and multiple DB
Post by: CrazyCat on September 18, 2019, 10:09:29 PM
Hello there,

I was wondering if it was possible to use separate DB with this module. Seems that no because only one engine can be set.

Do you think it could be possible to modify it to have more than one DB engine used ?
Title: Re: m_sql_authentication and multiple DB
Post by: McDeffice on September 28, 2019, 05:39:29 PM
Hello uncle CrazyCat,
You tried to add a block in "module {name = "m_mysql"}" by changing the value of name in "mysql {name = "mysql/main" }"

Code: [Select]
module
{
name = "m_mysql"

mysql
{
/* The name of this service. */
name = "mysql/main"
database = "anope"
server = "127.0.0.1"
username = "anope"
password = "mdp"
port = 3306
}
mysql
{
name = "mysql/secondary"
database = "anope"
server = "Host.Of.secondary.db"
username = "anope"
password = "mdp"
port = 3306
}
}
and in the module change "mysql/main" to "mysql/secondary"
Code: [Select]
module
{
name = "m_sql_authentication"

/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
engine = "mysql/secondary"

I did not try. this is a guess of solution
Title: Re: m_sql_authentication and multiple DB
Post by: CrazyCat on October 01, 2019, 03:27:37 PM
Hi McDefice :)

I think I didn't explain clearly my problem.
I already use m_sql_authentication with a DB which is not the one used by anope. But I'm looking for a way to use two databases for m_sql_authentication, doing something like:
Code: [Select]
module
{
name = "m_sql_authentication"
engine = "mysql/firstsite"
}
module
{
name = "m_sql_authentication"
engine = "mysql/secondsite"
}
The intention is to allow users from different websites to log in the network with their community identifiants.