diff --git a/application.example.yaml b/application.example.yaml index 87180c6..29be850 100644 --- a/application.example.yaml +++ b/application.example.yaml @@ -258,10 +258,32 @@ key.path: '/path/to/sign.key' #sql.connection: '/var/lib/matrix-synapse/homeserver.db' -# See ldap.attribute.uid.type for more info on possible values +# +# Example configuration to integrate with synapse PostgreSQL DB +#sql.enabled: true +#sql.type: 'postgresql' +#sql.connection: '//dnsOrIpToServer/dbName?user=synapseDbUser&password=synapseDbPassword' + + +# +# Configuration for an arbitrary server with arbitrary driver +# +# sql.identity.type possible values: +# - uid Returned value is the localpart of the Matrix ID +# - mxid Full Matrix ID, including domain +# +# sql.identity.query MUST contain a column with label 'uid' +# +# If you would like to overwrite the global lookup query for specific medium type, +# add a config item (see below for example) in the following format +# sql.identity.medium.theMediumIdYouWant: 'the query' + +#sql.enabled: true +#sql.type: 'jdbcDriverName' +#sql.connection: '//dnsOrIpToServer/dbName?user=synapseDbUser&password=synapseDbPassword' #sql.identity.type: 'mxid' -#sql.identity.query: 'SELECT user_id AS uid FROM user_threepids WHERE medium = ? AND address = ?' -#sql.identity.medium.email: "SELECT user_id AS uid FROM user_threepids WHERE medium = ? AND address = ?" +#sql.identity.query: 'SELECT raw AS uid FROM table WHERE medium = ? AND address = ?' +#sql.identity.medium.email: 'SELECT raw AS uid FROM emailTable WHERE address = ?' diff --git a/build.gradle b/build.gradle index f989cb4..0fd307c 100644 --- a/build.gradle +++ b/build.gradle @@ -113,6 +113,9 @@ dependencies { // SQLite compile 'org.xerial:sqlite-jdbc:3.20.0' + // PostgreSQL + compile 'org.postgresql:postgresql:42.1.4' + testCompile 'junit:junit:4.12' testCompile 'com.github.tomakehurst:wiremock:2.8.0' }