annotate Sphinx/source/plugins/odbc.rst @ 750:8b8df1be0cf9

documenting odbc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 13 Aug 2021 14:06:23 +0200
parents
children 37512473ffe9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
750
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _odbc:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 ODBC plugins
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 ============
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 .. contents::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 The Orthanc project provides two **official** plugins to replace the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 default storage area (on the filesystem) and the default SQLite index
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 by a `ODBC database
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 <https://en.wikipedia.org/wiki/Open_Database_Connectivity>`__. This
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 can notably be used to connect Orthanc to Microsoft SQL Server.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 The source code of the ODBC plugins can be found in the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 ``orthanc-databases`` `Mercurial repository
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 <https://hg.orthanc-server.com/orthanc-databases/>`__, next to the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 source code of the :ref:`PostgreSQL <postgresql>` and
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 :ref:`MySQL/MariaDB <mysql>` plugins.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 When to use ODBC?
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 -----------------
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 In general, you'll always get better performance by using native C/C++
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 plugins dedicated to one single database engine, instead of the ODBC
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 plugins that can connect to any database driver. This is the price of
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 genericity: Some specific optimisations can only be done if focusing
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 on one single database.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 That being said, there are multiple use cases for the ODBC plugins:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 * Connection to Microsoft SQL Server (MSSQL) is only possible with
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 ODBC. Note that the ODBC plugins were only validated against MSSQL
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 2017 and MSSQL 2019, under GNU/Linux.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 * Contrarily to the built-in SQLite engine and to the MySQL/MariaDB
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 index plugin, the ODBC index plugin supports the :ref:`revision
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 mechanism <revisions>` to protect metadata and attachments from
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 concurrent modifications.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 * Because of its genericity, the ODBC storage area plugin does not
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 implement the :ref:`read-range primitive <registry>`. As a
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 consequence, using it will write two attachments for each stored
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 DICOM instance (namely, ``Attachment 1`` that corresponds to the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 DICOM instance itself, and ``Attachment 3`` that corresponds to the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 tags before the pixel data).
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 * The Linux Standard Base (LSB) `pre-compiled binaries
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 <https://lsb.orthanc-server.com/plugin-odbc/>`__ of the ODBC plugins
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 are not compatible with the ``libsqliteodbc`` `Debian/Ubuntu package
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 <http://www.ch-werner.de/sqliteodbc/>`__ because the latter package
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 was compiled with the ``HAVE_SQLITE3LOADEXTENSION`` flag.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 * Finally, make sure to read the :ref:`recommended setup for best
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 scalability <scalability>`.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 Very importantly, pay attention to the fact that the ODBC plugins use
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 a different database schema than the built-in SQLite driver, and than
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 the PostgreSQL/MariaDB/MySQL plugins. As a consequence, it is **not
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 possible to switch back and forth** between ODBC and the native
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 drivers without running a :ref:`full replication procedure
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 <replication>`. As a consequence, pay attention to choose the right
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 plugin from the beginning, as you will need to stick to it.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 Summarizing, here are two tables containing our recommendations about
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 when to use the ODBC plugins:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 | Database management system | Recommended index plugin |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 +==============================+========================================================+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 | Microsoft SQL server (MSSQL) | ODBC plugin |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 | MySQL (with revisions) | ODBC plugin |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 | MySQL (without revisions) | :ref:`MySQL plugin <mysql>` |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 | PostgreSQL | :ref:`PostgreSQL plugin <postgresql>` |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 | SQLite (with revisions) | ODBC plugin |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 | SQLite (without revisions) | No plugin needed |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 | Other | Create a :ref:`dedicated plugin <creating-plugins>` |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 | | or implement a new dialect in the ODBC plugins |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 | Type of storage area | Recommended storage plugin |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 +==============================+========================================================+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 | Filesystem | No plugin needed |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 | Microsoft SQL server (MSSQL) | ODBC plugin |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 | MySQL | :ref:`MySQL plugin <mysql>` |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 | PostgreSQL | :ref:`PostgreSQL plugin <postgresql>` |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 | SQLite | ODBC plugin |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 | Google Cloud Storage, Azure | :ref:`Cloud object storage plugins <object-storage>` |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 | blob storage, AWS S3 | |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 | Other | Create a :ref:`dedicated plugin <creating-plugins>`, |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 | | implement a new dialect in the ODBC plugins, |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 | | or prototype using :ref:`Python <python_storage_area>` |
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 +------------------------------+--------------------------------------------------------+
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 Compilation
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 -----------
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 Static linking
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 ^^^^^^^^^^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 .. highlight:: text
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 The procedure to compile these plugins is similar to that for the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 :ref:`core of Orthanc <compiling>`. The following commands should work
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 for most UNIX-like distribution (including GNU/Linux)::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 $ mkdir BuildOdbc
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 $ cd BuildOdbc
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 $ cmake ../Odbc -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 $ make
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 The compilation will produce 2 shared libraries, each containing one plugin for Orthanc:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 * ``OrthancOdbcIndex`` replaces the default SQLite index of Orthanc by ODBC.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 * ``OrthancOdbcStorage`` makes Orthanc store the DICOM files it receives into ODBC.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 Microsoft Windows and Apple OS X
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 Pre-compiled binaries for Microsoft Windows 32bit `are also available
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 <https://www.orthanc-server.com/browse.php?path=/plugin-odbc>`__. A
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 package for `Apple's Mac OS X
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 <https://www.osimis.io/en/download.html>`__ is available courtesy of
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 `Osimis <https://www.osimis.io/>`__.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 .. _odbc-ubuntu1604:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 Dynamic linking on Ubuntu 16.04
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 .. highlight:: text
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 If static linking is not desired, here are build instructions for
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 Ubuntu 16.04 (provided build dependencies for the :ref:`core of
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 Orthanc <compiling>` have already been installed)::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 $ sudo apt-get install libodbc1 unixodbc unixodbc-dev
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 $ mkdir BuildOdbc
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 $ cd BuildOdbc
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 $ cmake ../Odbc -DCMAKE_BUILD_TYPE=Release \
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 -DALLOW_DOWNLOADS=ON \
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 -DUSE_SYSTEM_GOOGLE_TEST=OFF \
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 -DUSE_SYSTEM_ORTHANC_SDK=OFF
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 $ make
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 Usage
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 -----
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 .. highlight:: json
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 You of course first have to :ref:`install Orthanc <binaries>`, with a
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 version above 0.9.5. You then have to **configure an ODBC data
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 source** dedicated to Orthanc. The procedure depends upon your
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 operating system:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 * Many UNIX-like platforms (including Debian and Ubuntu) use `unixODBC
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 <https://en.wikipedia.org/wiki/UnixODBC>`__. You first have to
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 install at least one ODBC driver (e.g. on Debian, installing the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 packages ``libsqliteodbc`` and ``odbc-postgresql`` will respectively
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 install the driver for SQLite and for PostgreSQL). Secondly, you
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 have to edit your ``~/.odbc.ini`` to define the data sources
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 (i.e. the actual databases).
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 * On Microsoft Windows, the configuration tool ``odbcad32.exe`` ("ODBC
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 Data Source Administrator") allows to define the data sources. You
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 also have to install at least one ODBC driver. For instance, the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 `SQLite ODBC Driver <http://www.ch-werner.de/sqliteodbc/>`__ can be
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 used to access SQLite.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 * If you are interested in interfacing Orthanc with Microsoft SQL
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 Server, the corresponding ODBC drivers can be `downloaded from
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 Microsoft
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 <https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server>`__.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 Once Orthanc is installed and the data sources have been defined, you
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 must add a section in the :ref:`configuration file <configuration>`
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 that specifies the **data source(s) to be used**. You also have to
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 tell Orthanc in which path it can find the plugins: This is done by
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 properly modifying the ``Plugins`` option. You could for instance
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 adapt the following configuration file::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 "Name" : "MyOrthanc",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 "Odbc" : {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 "EnableIndex" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 "EnableStorage" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 "IndexConnectionString" : "DSN=index",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 "StorageConnectionString" : "DSN=storage",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 "MaximumConnectionRetries" : 10, // Optional
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 "ConnectionRetryInterval" : 5, // Optional
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 "IndexConnectionsCount" : 1 // Optional
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 },
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 "Plugins" : [
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 "/home/user/orthanc-databases/BuildOdbc/libOrthancOdbcIndex.so",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 "/home/user/orthanc-databases/BuildOdbc/libOrthancOdbcStorage.so"
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 ]
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 The values of ``IndexConnectionString`` and
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 ``StorageConnectionString`` are known as `ODBC connection strings
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 <https://www.connectionstrings.com/>`__, and define how to connect to
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 the ODBC data source. These connection strings are specific to the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 different types of ODBC drivers. In the following sections, we'll
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 review connection strings for SQLite, PostgreSQL, MySQL and Microsoft
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 SQL Server.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 **Important:** The ``EnableIndex`` and ``EnableStorage`` options must
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 be explicitly set to ``true``, otherwise Orthanc will continue to use
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 its default SQLite back-end and the filesystem storage area.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 **Remark 1:** When using the ODBC storage area plugin, the DICOM files
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 are stored as large objects in the database. This might actually
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 consume more space than the DICOM file itself.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 **Remark 2:** A typical usage of the ODBC plugins is to enable only
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 the index plugin, and to use the default filesystem storage for DICOM
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 files (on a NAS with proper disaster recovery strategies).
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 Orthanc must of course be **restarted** after the modification of its
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 configuration file.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 Supported ODBC drivers
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 ----------------------
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 The ODBC plugins for Orthanc are universal, in the sense that they can
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 connect to any ODBC driver. However, there are some minor variations
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 in the SQL language, that are known as "dialects" in the `source code
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 of the plugins <https://hg.orthanc-server.com/orthanc-databases/>`__.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 As of ODBC plugins 1.0, the supported dialects are Microsoft SQL
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 Server, PostgreSQL, MySQL and SQLite. Orthanc auto-detects the dialect
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 to be used. Adapting the ODBC plugins to support more dialects should
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 be fairly easy by adding new values to the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 ``OrthancDatabases::Dialect`` enumeration in the C++ source code.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 Also, note that the database for the index and the database for the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 storage area can mix different type of ODBC drivers.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 We now review sample `connection strings
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 <https://www.connectionstrings.com/>`__ for the supported ODBC drivers
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 under Ubuntu 18.04.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 Microsoft SQL Server
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 ^^^^^^^^^^^^^^^^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 .. highlight:: bash
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 1. Install the `ODBC driver for SQL server
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 <https://docs.microsoft.com/fr-fr/sql/connect/odbc/download-odbc-driver-for-sql-server>`__
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 (version 2017).
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 2. A **non-persistent** developer instance of MSSQL 2019 can be
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 started using the `Docker image provided by Microsoft
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 <https://hub.docker.com/_/microsoft-mssql-server>`__ as follows::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 $ docker run --name mssql --rm -t -i -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MyStrOngPa55word!' \
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 -e MSSQL_MEMORY_LIMIT_MB=512 -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 3. Create a database dedicated to Orthanc in MSSQL::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 $ /opt/mssql-tools/bin/sqlcmd -S 192.168.0.17 -U sa -P 'MyStrOngPa55word!' -Q 'CREATE DATABASE orthanctest'
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 .. highlight:: text
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 4. Create the following sample `unixODBC
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 <https://en.wikipedia.org/wiki/UnixODBC>`__ configuration file::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 $ cat ~/.odbc.ini
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 [orthanctest]
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 Driver = ODBC Driver 17 for SQL Server
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 Server = tcp:localhost,1433
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 Database = orthanctest
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 Note that there exist `many more configuration options
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 <https://docs.microsoft.com/en-us/sql/relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client>`__
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 for Microsoft SQL Server.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 .. highlight:: json
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 5. Start Orthanc using the following :ref:`configuration file
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 <configuration>` for ODBC::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 "Odbc" : {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 "EnableIndex" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 "EnableStorage" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 "IndexConnectionString" : "DSN=orthanctest;Uid=sa;Pwd=MyStrOngPa55word!",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 "StorageConnectionString" : "DSN=orthanctest;Uid=sa;Pwd=MyStrOngPa55word!"
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 In the connection strings:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 * ``DSN`` corresponds to the name of the entry in ``~/.odbc.ini``.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 * ``Uid`` is the user name in MSSQL (by default, the Docker image uses ``sa``).
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 * ``Pwd`` is the password that has been used when starting Docker.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 * For security reasons, the ``Uid`` and ``Pwd`` parameters cannot
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 be set in ``~/.odbc.ini``.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 PostgreSQL
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 ^^^^^^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 1. Install the ``odbc-postgresql`` package.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 2. Create the following sample `unixODBC
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 <https://en.wikipedia.org/wiki/UnixODBC>`__ configuration file::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 $ cat ~/.odbc.ini
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 [orthanctest]
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 Driver = PostgreSQL Unicode
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 Servername = localhost
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 Database = orthanctest
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 UserName = postgres
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 Password = postgres
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 Port = 5432
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 3. Start Orthanc using the following :ref:`configuration file
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 <configuration>` for ODBC::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 "Odbc" : {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 "EnableIndex" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 "EnableStorage" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 "IndexConnectionString" : "DSN=orthanctest",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 "StorageConnectionString" : "DSN=orthanctest"
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 MySQL
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 ^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 1. Install the official `Connect/ODBC package
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 <https://dev.mysql.com/downloads/connector/odbc/>`__ (it is not
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 packaged for Ubuntu 18.04).
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 2. Create the following sample `unixODBC
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 <https://en.wikipedia.org/wiki/UnixODBC>`__ configuration file::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 $ cat ~/.odbc.ini
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 [orthanctest]
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 Driver = MySQL ODBC 8.0 Unicode Driver
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 Servername = localhost
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 Database = orthanctest
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 UID = root
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 PWD = root
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 Port = 3306
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 3. Start Orthanc using the following :ref:`configuration file
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 <configuration>` for ODBC::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 "Odbc" : {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 "EnableIndex" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 "EnableStorage" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 "IndexConnectionString" : "DSN=orthanctest;charset=utf8",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 "StorageConnectionString" : "DSN=orthanctest;charset=utf8"
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 The ``charset=utf8`` option is necessary if using MySQL 8.x.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 SQLite
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 ^^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 1. Install the ``libsqliteodbc`` package.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 2. Create the following sample `unixODBC
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 <https://en.wikipedia.org/wiki/UnixODBC>`__ configuration file::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 $ cat ~/.odbc.ini
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 [index]
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 Driver=SQLite3
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 Database=/tmp/test-odbc-index.sqlite
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 [storage]
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 Driver=SQLite3
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 Database=/tmp/test-odbc-storage.sqlite
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 Note that we define two different data sources, one for the index
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 and another for the storage area, because a SQLite database can
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 only be opened by one client at once.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 3. Start Orthanc using the following :ref:`configuration file
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 <configuration>` for ODBC::
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 "Odbc" : {
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 "EnableIndex" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 "EnableStorage" : true,
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 "IndexConnectionString" : "DSN=index",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 "StorageConnectionString" : "DSN=storage",
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 "IndexConnectionsCount" : 1
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 }
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 **Remark 1:** As written just above, one SQLite database should
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 only be opened by one client at a time. This implies that the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 ``IndexConnectionsCount`` must be set to ``1``, and that the index
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 and storage area must never have connection strings corresponding
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 to the same SQLite database.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 **Remark 2:** As written above, the ODBC plugin supports the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 :ref:`revision mechanism <revisions>`. This contrasts with the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 built-in SQLite database of Orthanc. So, it might be interesting to
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 use the ODBC index plugin instead of the built-in SQLite database
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 of Orthanc, if you are a developer who wants to test revisions
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 before a :ref:`large-scale deployment <scalability>`.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 Advanced options
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 ----------------
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 Several advanced options are available as well to fine-tune the
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 configuration of the ODBC plugins. They are documented below.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 .. _odbc-multiple-writers:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 Multiple writers or connections
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 Starting with Orthanc 1.9.2, it is possible to use :ref:`multiple
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 writers or connections in large-scale deployments
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 <multiple-writers>`. Here is the list of configuration that control
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 this behaviour:
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 * ``MaximumConnectionRetries`` governs how many times Orthanc tries to
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 connect to the database, as well as how many times Orthanc replays
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 transactions to deal with collisions between multiple writers.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 * ``IndexConnectionsCount`` controls the number of connections from
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 the index plugin to the ODBC database. It is set to ``1`` by
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 default, which corresponds to the old behaviour of Orthanc <= 1.9.1.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 * ``ConnectionRetryInterval`` is only used when opening one database
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 connection to ODBC.
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 * These options cannot be used in the case of SQLite databases, that
8b8df1be0cf9 documenting odbc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 only support one client at once.