1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 04:01:40 +01:00

[doc] slightly improve documentation of SQL engines

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2024-10-03 12:58:32 +02:00 committed by Markus Heiser
parent 2a29e16d25
commit e7a4d7d7c3
5 changed files with 61 additions and 1 deletions

View File

@ -25,7 +25,7 @@ Relational Database Management System (RDBMS) are supported:
- :ref:`engine sqlite` - :ref:`engine sqlite`
- :ref:`engine postgresql` - :ref:`engine postgresql`
- :ref:`engine mysql_server` - :ref:`engine mysql_server` & :ref:`engine mariadb_server`
All of the engines above are just commented out in the :origin:`settings.yml All of the engines above are just commented out in the :origin:`settings.yml
<searx/settings.yml>`, as you have to set the required attributes for the <searx/settings.yml>`, as you have to set the required attributes for the
@ -119,3 +119,16 @@ MySQL
.. automodule:: searx.engines.mysql_server .. automodule:: searx.engines.mysql_server
:members: :members:
.. _engine mariadb_server:
MariaDB
--------
.. sidebar:: info
- :origin:`mariadb_server.py <searx/engines/mariadb_server.py>`
- ``pip install`` :pypi:`mariadb <mariadb>`
.. automodule:: searx.engines.mariadb_server
:members:

View File

@ -21,6 +21,9 @@ This is an example configuration for querying a MariaDB server:
limit: 5 limit: 5
query_str: 'SELECT * from my_table WHERE my_column=%(query)s' query_str: 'SELECT * from my_table WHERE my_column=%(query)s'
Implementations
===============
""" """
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
@ -39,12 +42,25 @@ if TYPE_CHECKING:
engine_type = 'offline' engine_type = 'offline'
host = "127.0.0.1" host = "127.0.0.1"
"""Hostname of the DB connector"""
port = 3306 port = 3306
"""Port of the DB connector"""
database = "" database = ""
"""Name of the database."""
username = "" username = ""
"""Username for the DB connection."""
password = "" password = ""
"""Password for the DB connection."""
query_str = "" query_str = ""
"""SQL query that returns the result items."""
limit = 10 limit = 10
paging = True paging = True
result_template = 'key-value.html' result_template = 'key-value.html'

View File

@ -34,12 +34,25 @@ except ImportError:
engine_type = 'offline' engine_type = 'offline'
auth_plugin = 'caching_sha2_password' auth_plugin = 'caching_sha2_password'
host = "127.0.0.1" host = "127.0.0.1"
"""Hostname of the DB connector"""
port = 3306 port = 3306
"""Port of the DB connector"""
database = "" database = ""
"""Name of the database."""
username = "" username = ""
"""Username for the DB connection."""
password = "" password = ""
"""Password for the DB connection."""
query_str = "" query_str = ""
"""SQL query that returns the result items."""
limit = 10 limit = 10
paging = True paging = True
result_template = 'key-value.html' result_template = 'key-value.html'

View File

@ -29,12 +29,25 @@ except ImportError:
pass pass
engine_type = 'offline' engine_type = 'offline'
host = "127.0.0.1" host = "127.0.0.1"
"""Hostname of the DB connector"""
port = "5432" port = "5432"
"""Port of the DB connector"""
database = "" database = ""
"""Name of the database."""
username = "" username = ""
"""Username for the DB connection."""
password = "" password = ""
"""Password for the DB connection."""
query_str = "" query_str = ""
"""SQL query that returns the result items."""
limit = 10 limit = 10
paging = True paging = True
result_template = 'key-value.html' result_template = 'key-value.html'

View File

@ -41,8 +41,13 @@ import sqlite3
import contextlib import contextlib
engine_type = 'offline' engine_type = 'offline'
database = "" database = ""
"""Filename of the SQLite DB."""
query_str = "" query_str = ""
"""SQL query that returns the result items."""
limit = 10 limit = 10
paging = True paging = True
result_template = 'key-value.html' result_template = 'key-value.html'