Skip to content

Commit 3412840

Browse files
docs: update to database_prefix and 2.x version (#142)
- Front page: Update to indicate 2.0-2.1 pre-release coverage - Rename database.schema_prefix to database.database_prefix - Rename DJ_SCHEMA_PREFIX to DJ_DATABASE_PREFIX This aligns with datajoint-python PR #1351 which renames the setting to avoid confusion with store's schema_prefix (schema-addressed storage). Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 385ecca commit 3412840

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/how-to/deploy-production.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,30 +90,30 @@ class NewTable(dj.Manual):
9090
NewTable() # Creates the table
9191
```
9292

93-
## Use Schema Prefixes
93+
## Use Database Prefixes
9494

9595
When multiple projects share a database server, use prefixes to avoid naming collisions and organize schemas.
9696

97-
### Configure Project Prefix
97+
### Configure Database Prefix
9898

9999
```python
100100
import datajoint as dj
101101

102-
dj.config.database.schema_prefix = 'myproject_'
102+
dj.config.database.database_prefix = 'myproject_'
103103
```
104104

105105
Or via environment variable:
106106

107107
```bash
108-
export DJ_SCHEMA_PREFIX=myproject_
108+
export DJ_DATABASE_PREFIX=myproject_
109109
```
110110

111111
Or in `datajoint.json`:
112112

113113
```json
114114
{
115115
"database": {
116-
"schema_prefix": "myproject_"
116+
"database_prefix": "myproject_"
117117
}
118118
}
119119
```
@@ -125,7 +125,7 @@ Use the prefix when creating schemas:
125125
```python
126126
import datajoint as dj
127127

128-
prefix = dj.config.database.schema_prefix # 'myproject_'
128+
prefix = dj.config.database.database_prefix # 'myproject_'
129129

130130
# Schema names include prefix
131131
subject_schema = dj.Schema(prefix + 'subject') # myproject_subject
@@ -197,7 +197,7 @@ export DJ_PASS=prod_password
197197

198198
# Production mode
199199
export DJ_CREATE_TABLES=false
200-
export DJ_SCHEMA_PREFIX=myproject_
200+
export DJ_DATABASE_PREFIX=myproject_
201201

202202
# Disable interactive prompts
203203
export DJ_SAFEMODE=false
@@ -215,7 +215,7 @@ services:
215215
environment:
216216
- DJ_HOST=db.example.com
217217
- DJ_CREATE_TABLES=false
218-
- DJ_SCHEMA_PREFIX=prod_
218+
- DJ_DATABASE_PREFIX=prod_
219219
volumes:
220220
# Mount secrets directory
221221
- type: bind
@@ -282,7 +282,7 @@ export DJ_PASS=<from-secret-manager>
282282

283283
# Production behavior
284284
export DJ_CREATE_TABLES=false
285-
export DJ_SCHEMA_PREFIX=prod_
285+
export DJ_DATABASE_PREFIX=prod_
286286
export DJ_SAFEMODE=false
287287

288288
# Logging
@@ -304,9 +304,9 @@ def verify_production_config():
304304
if dj.config.database.create_tables:
305305
errors.append("create_tables should be False in production")
306306

307-
# Check schema prefix is set
308-
if not dj.config.database.schema_prefix:
309-
errors.append("schema_prefix should be set in production")
307+
# Check database prefix is set
308+
if not dj.config.database.database_prefix:
309+
errors.append("database_prefix should be set in production")
310310

311311
# Check not pointing to localhost
312312
if dj.config.database.host == 'localhost':
@@ -330,7 +330,7 @@ if __name__ == '__main__':
330330
| Setting | Development | Production |
331331
|---------|-------------|------------|
332332
| `database.create_tables` | `true` | `false` |
333-
| `database.schema_prefix` | `""` or `dev_` | `prod_` |
333+
| `database.database_prefix` | `""` or `dev_` | `prod_` |
334334
| `safemode` | `true` | `false` (automated) |
335335
| `loglevel` | `DEBUG` | `WARNING` |
336336

src/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# DataJoint Documentation
22

3-
!!! info "Documentation for DataJoint 2.0 (Pre-Release)"
3+
!!! info "Documentation for DataJoint 2.x (Pre-Release)"
44

5-
This documentation covers **DataJoint 2.0**, currently in pre-release.
5+
This documentation covers **DataJoint 2.0–2.1**, currently in pre-release.
66

77
- **Using stable 0.14.x?** Visit [legacy docs](https://datajoint.github.io/datajoint-python)
8-
- **Want to test 2.0?** See [Installation Guide](how-to/installation.md)
8+
- **Want to test 2.x?** See [Installation Guide](how-to/installation.md)
99
- **Migrating a pipeline?** Follow the [Migration Guide](how-to/migrate-to-v20.md)
1010

1111
## About DataJoint

src/reference/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Configuration is loaded in priority order:
2121
| `database.password` | `DJ_PASS` || Database password (required) |
2222
| `database.reconnect` || `True` | Auto-reconnect on connection loss |
2323
| `database.use_tls` || `None` | Enable TLS encryption |
24-
| `database.schema_prefix` | `DJ_SCHEMA_PREFIX` | `""` | Project-specific prefix for schema names |
24+
| `database.database_prefix` | `DJ_DATABASE_PREFIX` | `""` | Prefix for database/schema names |
2525
| `database.create_tables` | `DJ_CREATE_TABLES` | `True` | Default for `Schema(create_tables=)`. Set `False` for production mode |
2626

2727
## Connection Settings

0 commit comments

Comments
 (0)