From 8cfaf304abebc78dbb7715505f40771dc89bae43 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 5 Apr 2016 23:41:54 +0300 Subject: [PATCH] Update docs: DB URI Add a section about m_librarian.conf configuration file and Database URIs. --- Makefile | 4 ++-- docs-ru/before_begin.rst | 22 ++++++++++++++++++++++ docs/before_begin.rst | 22 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 20168df..9a8f3ba 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ all: .PHONY: htmldoc htmldoc: - $(MAKE) -C doc html - $(MAKE) -C doc-ru html + $(MAKE) -C docs html + $(MAKE) -C docs-ru html .PHONY: test test: diff --git a/docs-ru/before_begin.rst b/docs-ru/before_begin.rst index e23543a..52cf83f 100644 --- a/docs-ru/before_begin.rst +++ b/docs-ru/before_begin.rst @@ -52,5 +52,27 @@ m_Librarian пока не научился индексировать архив вам придётся создать самим. Для SQLite файл БД будет создан программой, так что это наиболее простой способ использования m_Librarian, +Database URI +^^^^^^^^^^^^ + +Чтобы m_Librarian использовал сервер SQL создайте файл конфигурации и +поместите его в $HOME/.config/ (если у вас POSIX-совместимая ОС). Файл +должен называться ``m_librarian.conf``. Это должен быть файл в формате +``ini``, в нём должна быть единственная секция ``[database]`` с +единственным ключом ``URI``. Значением ключа должно быть Database URI в +формате, который понимает SQLObject. Вот несколько примеров:: + + [database] + URI = mysql://user:password@host/database + + [database] + URI = postgres://user@host/database + + [database] + URI = sqlite:///full/path/to/database + +Больше примеров есть в файле sample/m_librarian.conf. Детальное описание +DB URI есть в `документации на SQLObject +`_. .. vim: set tw=72 : diff --git a/docs/before_begin.rst b/docs/before_begin.rst index d7521e0..adc1a2c 100644 --- a/docs/before_begin.rst +++ b/docs/before_begin.rst @@ -33,5 +33,27 @@ to use an SQL server you must create a database yourself. For SQLite, the database file will be created by the program, so it's the simplest way of using m_Librarian. +Database URI +^^^^^^^^^^^^ + +For m_Librarian to use an SQL server create a configuration file and put +it in $HOME/.config/ (if your OS is POSIX-compatible). Name the +configuration file ``m_librarian.conf``. It must be in ``ini``-file +format and must have the only section ``[database]`` with the only key +``URI``. The value for the key must be a Database URI in format accepted +by SQLObject. Some examples:: + + [database] + URI = mysql://user:password@host/database + + [database] + URI = postgres://user@host/database + + [database] + URI = sqlite:///full/path/to/database + +See some more examples in sample/m_librarian.conf. See detailed +description for DB URIs in `SQLObject documentation +`_. .. vim: set tw=72 : -- 2.39.2