Skip to content

Commit 0bf5478

Browse files
author
Chris Turner
committed
docs-parts/existing/1-Loading-Classes_lang1.rst: rework text, add full example.
................................................................................
1 parent 875c894 commit 0bf5478

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs-parts/existing/1-Loading-Classes_lang1.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
Creating a virtual class
33
~~~~~~~~~~~~~~~~~~~~~~~~
44

5-
A ``TableAccessor`` object is created as a property of a schema during each schema's creation.
6-
This property is named ``schema.v``, for *virtual class generator*.
7-
The ``TableAccessor`` ``v`` itself has properties that refer to the tables of the schema.
8-
For example, one can access the ``Session`` table using ``schema.v.Session`` with no need for any ``Session`` class to exist in MATLAB.
9-
Tab completion of table names is possible because the table names are added as dynamic properties of ``TableAccessor``.
5+
To facilitate working with existing pipelines, DataJoint MATLAB creates a ``TableAccessor`` property in each schema object.
6+
The ``TableAccessor`` property, a *virtual class generator*, is available as ``schema.v``, and allows listing and querying of the tables defined on the server without needing to create the MATLAB table definitions locally.
7+
For example, creating a scratch ``experiment`` schema package and querying an existing ``my_experiment.Session`` table on the server can be done as follows::
8+
9+
>> dj.createSchema('experiment', '/scratch', 'my_experiment')
10+
>> addpath('/scratch')
11+
>> experiment_schema = experiment.getSchema();
12+
>> experiment_schema.v.Session() & 'session_id=1234';
13+
14+
.. note::
15+
16+
You can view the available tables in a schema by using tab completion on the ``schema.v`` property.

0 commit comments

Comments
 (0)