You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section describes how to work with database schemas without access to the original
4
-
code that generated the schema. These situations often arise when the database is
5
-
created by another user who has not shared the generating code yet or when the database
6
-
schema is created from a programming language other than Python.
7
-
8
3
## Loading Classes
9
4
10
-
Typically, a DataJoint schema is created as a dedicated Python module. This module
11
-
defines a schema object that is used to link classes declared in the module to tables
12
-
in the database schema. With the module installed, you can simply import it to interact
13
-
with its tables:
5
+
This section describes how to work with database schemas without access to the
6
+
original code that generated the schema. These situations often arise when the
7
+
database is created by another user who has not shared the generating code yet
8
+
or when the database schema is created from a programming language other than
9
+
Python.
14
10
15
11
```python
16
12
import datajoint as dj
17
-
from element_calcium_imaging import scan # This and other [DataJoint Elements](https://datajoint.com/docs/elements/) are installable via `pip` or downloadable via their respective GitHub repositories.
18
13
```
19
14
20
-
To visualize an unfamiliar schema, see commands for generating [diagrams](../../getting-started/#diagram).
15
+
### Working with schemas and their modules
16
+
17
+
Typically a DataJoint schema is created as a dedicated Python module. This
18
+
module defines a schema object that is used to link classes declared in the
19
+
module to tables in the database schema. As an example, examine the university
Now imagine that you do not have access to `university.py` or you do not have
52
+
its latest version. You can still connect to the database schema but you will
53
+
not have classes declared to interact with it.
54
+
55
+
So let's start over in this scenario.
56
+
57
+
You may use the `dj.list_schemas` function (new in DataJoint 0.12.0) to
58
+
list the names of database schemas available to you.
28
59
29
60
```python
30
61
import datajoint as dj
31
-
dj.conn() # Establish a connection to the server.
32
-
dj.list_schemas() # List the available schemas on the server.
33
-
dj.Schema('schema_name').list_tables() # List the tables for a given schema from the previous step. These will appear in their raw database form, with underscores instead of camelcase and special characters for Part tables.
0 commit comments