Skip to content

Commit 783ced6

Browse files
docs: Add 2.1 settings and update migration guide for fetch() compatibility (#145)
* docs: Add DataJoint 2.1 settings to configuration reference - Add database.backend (DJ_BACKEND) for PostgreSQL support (new in 2.1) - Add DJ_USE_TLS env var support (new in 2.1) - Add display.diagram_direction (DJ_DIAGRAM_DIRECTION) (new in 2.1) - Update port to show auto-detection (3306/5432) - Add Environment column to Display Settings table Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: note that fetch() remains available with deprecation warning - Add note after Query API Changes table - Update AI agent prompt to say 'recommended' instead of 'always convert' - Update verification checklist to allow intentionally kept fetch() calls - Note that download_path parameter is not supported * docs: remove incorrect note about download_path not being supported download_path works via config context in the new approach * docs: Add Aeon platform to publications list --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 249f133 commit 783ced6

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

src/about/publications.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ If your work uses DataJoint or DataJoint Elements, please cite the respective
66

77
## 2025
88

9+
+ Campagner, D., Bhagat, J., Lopes, G., Calcaterra, L., Pouget, A. G., Almeida, A., ... & SWC GCNU Experimental Neuroethology Group. (2025). [Aeon: an open-source platform to study the neural basis of ethological behaviours over naturalistic timescales](https://doi.org/10.1101/2025.07.31.664513). *bioRxiv*.
10+
911
+ Bae, J. A., Baptiste, M., Bodor, A. L., Brittain, D., Buchanan, J., Bumbarger, D. J., Castro, M. A., Celii, B., Cobos, E., Collman, F., ... (2025). [Functional connectomics spanning multiple areas of mouse visual cortex](https://doi.org/10.1038/s41586-025-08790-w). *Nature*, 640(8058), 435-447.
1012

1113
+ Celii, B., Papadopoulos, S., Ding, Z., Fahey, P. G., Wang, E., Papadopoulos, C., ... & Reimer, J. (2025). [NEURD offers automated proofreading and feature extraction for connectomics](https://doi.org/10.1038/s41586-025-08660-5). *Nature*, 640(8058), 487-496.

src/how-to/migrate-to-v20.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ DataJoint 2.0 replaces `external.*` with unified `stores.*` configuration:
245245
| `dj.ERD(schema)` | `dj.Diagram(schema)` | I |
246246
| `table.insert([(1, 'a'), (2, 'b')])` | Must use dicts/DataFrames (no positional tuples) | I |
247247

248+
> **Note:** The `fetch()` method remains available in DataJoint 2.0 with a deprecation warning. Your existing code will work immediately—`fetch()` automatically delegates to the appropriate 2.0 method (`to_arrays()`, `to_dicts()`, or `to_pandas()`). You can migrate incrementally as time permits.
249+
248250
**Learn more:** [Fetch API Reference](../reference/specs/fetch-api.md) · [Query Operators Reference](../reference/operators.md) · [Semantic Matching](../reference/specs/semantic-matching.md)
249251

250252
---
@@ -1437,6 +1439,9 @@ Update all DataJoint API calls to 2.0 patterns.
14371439
14381440
**Fetch API:**
14391441
1442+
> **Note:** `fetch()` remains available with a deprecation warning and works immediately.
1443+
> Convert to new methods when convenient for cleaner, more explicit code.
1444+
14401445
- `fetch()``to_arrays()` (recarray-like) or `to_dicts()` (list of dicts)
14411446
- `fetch(..., format="frame")``to_pandas()` (pandas DataFrame)
14421447
- `fetch('attr1', 'attr2')``to_arrays('attr1', 'attr2')` (returns tuple)
@@ -1486,9 +1491,14 @@ CONTEXT:
14861491

14871492
API CONVERSIONS:
14881493

1489-
1. Fetch API (always convert):
1494+
1. Fetch API (recommended conversion - fetch() still works with deprecation warning):
1495+
1496+
NOTE: fetch() remains available in 2.0 and automatically delegates to the
1497+
new methods. Existing code works immediately. Convert when convenient.
1498+
14901499
OLD: data = table.fetch()
14911500
NEW: data = table.to_arrays() # recarray-like
1501+
# OR: keep as fetch() - works with deprecation warning
14921502

14931503
OLD: data = table.fetch(as_dict=True)
14941504
NEW: data = table.to_dicts() # list of dicts
@@ -1588,7 +1598,7 @@ PROCESS:
15881598

15891599
VERIFICATION:
15901600

1591-
- No .fetch() calls remaining (except fetch1)
1601+
- .fetch() calls either converted OR intentionally kept (works with deprecation warning)
15921602
- No .fetch1('KEY') calls remaining (replaced with .keys())
15931603
- No ._update() calls remaining
15941604
- No @ operator between tables
@@ -1732,7 +1742,7 @@ API conversions: X fetch, Y update, Z join"
17321742
- [ ] All table definitions use 2.0 type syntax
17331743
- [ ] All in-table codecs converted (`<blob>`, `<attach>`)
17341744
- [ ] All in-store codecs converted (`<blob@>`, `<attach@>`, `<filepath@>`)
1735-
- [ ] All `fetch()` calls converted (except `fetch1()`)
1745+
- [ ] All `fetch()` calls converted OR intentionally kept (works with deprecation warning)
17361746
- [ ] All `fetch(..., format="frame")` converted to `to_pandas()`
17371747
- [ ] All `fetch1('KEY')` converted to `keys()`
17381748
- [ ] All `._update()` calls converted

src/reference/configuration.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ Configuration is loaded in priority order:
1515

1616
| Setting | Environment | Default | Description |
1717
|---------|-------------|---------|-------------|
18+
| `database.backend` | `DJ_BACKEND` | `mysql` | Database backend: `mysql` or `postgresql` *(new in 2.1)* |
1819
| `database.host` | `DJ_HOST` | `localhost` | Database server hostname |
19-
| `database.port` | `DJ_PORT` | `3306` | Database server port |
20+
| `database.port` | `DJ_PORT` | `3306`/`5432` | Database server port (auto-detects from backend) |
2021
| `database.user` | `DJ_USER` || Database username (required) |
2122
| `database.password` | `DJ_PASS` || Database password (required) |
2223
| `database.reconnect` || `True` | Auto-reconnect on connection loss |
23-
| `database.use_tls` | | `None` | Enable TLS encryption |
24+
| `database.use_tls` | `DJ_USE_TLS` | `None` | Enable TLS encryption *(env var new in 2.1)* |
2425
| `database.database_prefix` | `DJ_DATABASE_PREFIX` | `""` | Prefix for database/schema names |
2526
| `database.create_tables` | `DJ_CREATE_TABLES` | `True` | Default for `Schema(create_tables=)`. Set `False` for production mode |
2627

@@ -157,11 +158,12 @@ If table lacks partition attributes, it follows normal path structure.
157158

158159
## Display Settings
159160

160-
| Setting | Default | Description |
161-
|---------|---------|-------------|
162-
| `display.limit` | `12` | Max rows to display |
163-
| `display.width` | `14` | Column width |
164-
| `display.show_tuple_count` | `True` | Show row count in output |
161+
| Setting | Environment | Default | Description |
162+
|---------|-------------|---------|-------------|
163+
| `display.limit` || `12` | Max rows to display |
164+
| `display.width` || `14` | Column width |
165+
| `display.show_tuple_count` || `True` | Show row count in output |
166+
| `display.diagram_direction` | `DJ_DIAGRAM_DIRECTION` | `LR` | Diagram layout: `LR` (left-right) or `TB` (top-bottom) *(new in 2.1)* |
165167

166168
## Top-Level Settings
167169

0 commit comments

Comments
 (0)