# SQL Identity store ## Supported Databases - PostgreSQL - MariaDB - MySQL - SQLite ## Features | Name | Supported? | |----------------|------------| | Authentication | No | | Directory | Yes | | Identity | Yes | Due to the implementation complexity of supporting arbitrary hashing/encoding mechanisms or auth flow, Authentication will be out of scope of SQL Identity stores and should be done via one of the other identity stores, typically the [REST Identity store](rest.md). ## Configuration ### Basic ```yaml sql.enabled: ``` Enable/disable the identity store --- ```yaml sql.type: ``` Set the SQL backend to use: - `sqlite` - `postgresql` - `mariadb` - `mysql` ### Connection #### SQLite ```yaml sql.connection: ``` Set the value to the absolute path to the Synapse SQLite DB file. Example: `/path/to/sqlite/file.db` #### Others ```yaml sql.connection: // value: threepid: type: value: ``` For each query, `type` can be used to tell mxisd how to process the ID column: - `localpart` will append the `matrix.domain` to it - `mxid` will use the ID as-is. If it is not a valid Matrix ID, the search will fail. `value` is the SQL query and must return two columns: - The first being the User ID - The second being its display name Example: ```yaml sql.directory.query: name: type: 'localpart' value: 'SELECT idColumn, displayNameColumn FROM table WHERE displayNameColumn LIKE ?' threepid: type: 'localpart' value: 'SELECT idColumn, displayNameColumn FROM table WHERE threepidColumn LIKE ?' ``` ### Identity ```yaml sql.identity.type: sql.identity.query: ```