@@ -10,8 +10,8 @@ to enable fast, seamless, and scalable storage integration.
10
10
Out of the box, we support three database backend:
11
11
12
12
#. :ref: `EphemeralDB Config `, an in-memory database
13
- #. :ref: `PickledDB Config `, a file-based database
14
- #. :ref: `MongoDB Config `, a document-oriented database (default)
13
+ #. :ref: `PickledDB Config `, a file-based database (default)
14
+ #. :ref: `MongoDB Config `, a document-oriented database
15
15
16
16
In this document, we'll review the different methods by which you can configure which database Oríon
17
17
will use during its execution. This page also contains the :ref: `installation instructions for
@@ -28,10 +28,10 @@ This will create a yaml file of the following format.
28
28
29
29
.. code-block :: yaml
30
30
31
- database :
32
- type : ' mongodb '
33
- name : ' orion_test '
34
- host : ' mongodb://user:pass@localhost '
31
+ storage :
32
+ database :
33
+ type : ' pickleddb '
34
+ host : ' /path/to/a/file.pkl '
35
35
36
36
The file is typically located at ``$HOME/.config/orion.core/orion_config.yaml `` but it may differ
37
37
based on your operating system.
@@ -40,10 +40,8 @@ The second way of configuring the database backend is to use environment variabl
40
40
41
41
.. code-block :: sh
42
42
43
- ORION_DB_ADDRESS=mongodb://user:pass@localhost
44
- ORION_DB_NAME=orion_test
45
- ORION_DB_TYPE=MongoDB
46
- ORION_DB_PORT=27017
43
+ ORION_DB_ADDRESS=/path/to/a/file.pkl
44
+ ORION_DB_TYPE=PickledDB
47
45
48
46
Note that both configuration methods can be used together, environment variables that are set will
49
47
overwrite the corresponding values in the global configuration. This is useful if you need to define
@@ -79,37 +77,27 @@ stage.
79
77
$ orion db test
80
78
81
79
Check for a configuration inside the default paths...
82
- {' type' : ' mongodb' , ' name' : ' mydb' , ' host' : ' localhost' }
80
+ {' name' : ' orion' , ' type' : ' pickleddb' , ' host' : ' ' , ' port' : 27017}
81
+ Success
82
+ Check if configuration file has valid database configuration...
83
+ {' name' : ' orion' , ' type' : ' pickleddb' , ' host' : ' ' , ' port' : 27017}
83
84
Success
84
-
85
- Check for a configuration inside the environment variables... Skipping
86
- No environment variables found.
87
-
88
- Check if configuration file has valid database configuration... Skipping
89
- Missing configuration file.
90
85
91
86
[...]
92
87
93
- In the last example, we can observe that the last two tests were skipped because there were no
94
- environment variables or local configuration file specified.
95
-
96
- Alternatively, here' s an example including all three configuration methods.
88
+ Alternatively, here' s an example including all configuration methods.
89
+ This is with MongoDB since there are more options to play with.
97
90
98
91
.. code-block:: sh
99
92
100
- $ ORION_DB_PORT=27018
93
+ $ ORION_DB_NAME=test
101
94
$ orion db test --config local.yaml
102
95
103
96
Check for a configuration inside the global paths...
104
- {' type' : ' mongodb' , ' name' : ' mydb' , ' host' : ' localhost' }
105
- Success
106
-
107
- Check for a configuration inside the environment variables...
108
- {' type' : ' mongodb' , ' name' : ' mydb' , ' host' : ' localhost' , ' port' : ' 27018' }
97
+ {' name' : ' test' , ' type' : ' pickleddb' , ' host' : ' ' , ' port' : 27017}
109
98
Success
110
-
111
99
Check if configuration file has valid database configuration...
112
- {' type' : ' mongodb' , ' name ' : ' mydb ' , ' host' : ' localhost' , ' port ' : ' 27017 ' }
100
+ {' type' : ' mongodb' , ' host' : ' localhost' }
113
101
Success
114
102
115
103
[...]
@@ -123,9 +111,9 @@ that will be used and then prints the instance created to confirm the database t
123
111
124
112
[...]
125
113
126
- Using configuration: {' type ' : ' mongodb ' , ' name ' : ' mydb ' , ' host' : ' localhost ' }
114
+ Using configuration: {' name ' : ' orion ' , ' type ' : ' pickleddb ' , ' host' : ' ' , ' port ' : 27017 }
127
115
Check if database of specified type can be created... Success
128
- DB instance <orion.core.io.database.mongodb.MongoDB object at 0x7f86d70067f0>
116
+ DB instance <orion.core.io.database.pickleddb.PickledDB object at 0x7f86d70067f0>
129
117
130
118
[...]
131
119
@@ -234,7 +222,7 @@ To install MongoDB locally, follow the `official instructions
234
222
<https://docs.mongodb.com/manual/administration/install-community/>`_ for your operating system.
235
223
Alternatively, use :ref:`MongoDB Atlas <mongodb-atlas>` to create a database in the cloud.
236
224
237
- Once MondoDB is installed, create the database using:
225
+ Once MongoDB is installed, create the database using:
238
226
239
227
.. code-block:: sh
240
228
0 commit comments