erdscope 0.4.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: erdscope
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Interactive, self-contained ER-diagram HTML and Excel table definitions from a MySQL, PostgreSQL, or SQLite database and/or application code (Rails / Prisma / Django) — single file, zero required dependencies
5
5
  Author: tas6
6
6
  License-Expression: MIT
@@ -54,9 +54,10 @@ erdscope sqlite:///path/to/app.db -o erd.html
54
54
 
55
55
  - **Database** (MySQL / PostgreSQL / SQLite) — the source of truth for tables, columns,
56
56
  comments, indexes, and real foreign keys.
57
- - **Application code** (`--models`: Rails / Prisma / Django) adds association semantics
58
- the database cannot express (`has_many :through`, polymorphic, ...), and can stand on
59
- its own when there is no DB to point at.
57
+ - **Application code** (`--models`: Rails / Prisma / Django, or a Rails `db/schema.rb` —
58
+ see [Typed input sources](#typed-input-sources-sources) below) adds association
59
+ semantics the database cannot express (`has_many :through`, polymorphic, ...), and can
60
+ stand on its own when there is no DB to point at.
60
61
  - **Config file** (`tables:`) — declare or patch a schema by hand: add tables, columns,
61
62
  indexes, and associations, or override and delete what the DB or code got wrong.
62
63
 
@@ -225,6 +226,47 @@ something that actually exists once all sources are merged) — typos never pass
225
226
  The full `tables:` schema, the `drop`/`replace` operations, and the precedence rules are
226
227
  documented in the [manual](https://orapli.github.io/erdscope/manual.html#config-file).
227
228
 
229
+ ### Typed input sources (`sources:`)
230
+
231
+ `--models`/config `models` auto-detect what kind of project a path is. The config-only
232
+ **`sources:`** list is the typed alternative: each entry names its own `type`, so nothing
233
+ needs detecting and several inputs can be declared explicitly and unambiguously —
234
+ including **`rails.schema`**, which statically parses a Rails `db/schema.rb` file
235
+ (columns, indexes, real foreign keys) with **no live database and no Ruby execution**:
236
+
237
+ ```yaml
238
+ version: 1
239
+ sources:
240
+ - id: schema
241
+ type: rails.schema
242
+ path: db/schema.rb
243
+ - id: app
244
+ type: rails.models # every registered overlay gets its own <name>.models type
245
+ path: app/models
246
+ ```
247
+
248
+ (The optional top-level `version: 1` is a config-format marker — currently the only
249
+ supported value, with no other effect; it's for future config-format changes to key off.)
250
+
251
+ A **`rails.project`** entry is a macro for a whole Rails app root: it expands to both the
252
+ `rails.schema` (`<root>/db/schema.rb`) and `rails.models` (`<root>/app/models`) halves,
253
+ whichever exist —
254
+
255
+ ```yaml
256
+ sources:
257
+ - id: app
258
+ type: rails.project
259
+ path: ../myapp
260
+ ```
261
+
262
+ is equivalent to declaring both `rails.schema` and `rails.models` entries above. A
263
+ `schema.rb`-derived foreign key merges as a **schema FK** (a teal badge in the viewer,
264
+ distinct from a live `DB FK`), and the merge authority order extends to
265
+ **Config > live DB > rails.schema > models** (physical facts) — a `schema.rb` dump is
266
+ closer to the real database than code is, but a live DB read still wins when both are
267
+ present. See the [Input sources chapter of the manual](https://orapli.github.io/erdscope/manual.html#input-sources)
268
+ for the full `sources[]` reference.
269
+
228
270
  ## Dependencies
229
271
 
230
272
  `erd.py` runs with **zero required dependencies** — everything below is optional, and
@@ -258,7 +300,8 @@ Feature highlights — each link goes to the relevant [manual](https://orapli.gi
258
300
  column comments, indexes, and real FK constraints, read from the database catalog
259
301
  (`information_schema` on MySQL, `pg_catalog` on PostgreSQL)
260
302
  - **Code semantics on top** — `--models` merges Rails / Prisma / Django associations;
261
- declared, DB-FK, and inferred edges stay [visually distinct](https://orapli.github.io/erdscope/manual.html#viewer-edges)
303
+ declared, DB-FK, schema FK (a statically-parsed `rails.schema` foreign key), and
304
+ inferred edges stay [visually distinct](https://orapli.github.io/erdscope/manual.html#viewer-edges)
262
305
  - **[Interactive exploration](https://orapli.github.io/erdscope/manual.html#viewer-guide)** — focus with depth and dependency
263
306
  direction, two-level hiding, table *and column* search (with regex/case toggles), a
264
307
  non-filtering Highlight search that survives into exports, named views, share links
@@ -20,9 +20,10 @@ erdscope sqlite:///path/to/app.db -o erd.html
20
20
 
21
21
  - **Database** (MySQL / PostgreSQL / SQLite) — the source of truth for tables, columns,
22
22
  comments, indexes, and real foreign keys.
23
- - **Application code** (`--models`: Rails / Prisma / Django) adds association semantics
24
- the database cannot express (`has_many :through`, polymorphic, ...), and can stand on
25
- its own when there is no DB to point at.
23
+ - **Application code** (`--models`: Rails / Prisma / Django, or a Rails `db/schema.rb` —
24
+ see [Typed input sources](#typed-input-sources-sources) below) adds association
25
+ semantics the database cannot express (`has_many :through`, polymorphic, ...), and can
26
+ stand on its own when there is no DB to point at.
26
27
  - **Config file** (`tables:`) — declare or patch a schema by hand: add tables, columns,
27
28
  indexes, and associations, or override and delete what the DB or code got wrong.
28
29
 
@@ -191,6 +192,47 @@ something that actually exists once all sources are merged) — typos never pass
191
192
  The full `tables:` schema, the `drop`/`replace` operations, and the precedence rules are
192
193
  documented in the [manual](https://orapli.github.io/erdscope/manual.html#config-file).
193
194
 
195
+ ### Typed input sources (`sources:`)
196
+
197
+ `--models`/config `models` auto-detect what kind of project a path is. The config-only
198
+ **`sources:`** list is the typed alternative: each entry names its own `type`, so nothing
199
+ needs detecting and several inputs can be declared explicitly and unambiguously —
200
+ including **`rails.schema`**, which statically parses a Rails `db/schema.rb` file
201
+ (columns, indexes, real foreign keys) with **no live database and no Ruby execution**:
202
+
203
+ ```yaml
204
+ version: 1
205
+ sources:
206
+ - id: schema
207
+ type: rails.schema
208
+ path: db/schema.rb
209
+ - id: app
210
+ type: rails.models # every registered overlay gets its own <name>.models type
211
+ path: app/models
212
+ ```
213
+
214
+ (The optional top-level `version: 1` is a config-format marker — currently the only
215
+ supported value, with no other effect; it's for future config-format changes to key off.)
216
+
217
+ A **`rails.project`** entry is a macro for a whole Rails app root: it expands to both the
218
+ `rails.schema` (`<root>/db/schema.rb`) and `rails.models` (`<root>/app/models`) halves,
219
+ whichever exist —
220
+
221
+ ```yaml
222
+ sources:
223
+ - id: app
224
+ type: rails.project
225
+ path: ../myapp
226
+ ```
227
+
228
+ is equivalent to declaring both `rails.schema` and `rails.models` entries above. A
229
+ `schema.rb`-derived foreign key merges as a **schema FK** (a teal badge in the viewer,
230
+ distinct from a live `DB FK`), and the merge authority order extends to
231
+ **Config > live DB > rails.schema > models** (physical facts) — a `schema.rb` dump is
232
+ closer to the real database than code is, but a live DB read still wins when both are
233
+ present. See the [Input sources chapter of the manual](https://orapli.github.io/erdscope/manual.html#input-sources)
234
+ for the full `sources[]` reference.
235
+
194
236
  ## Dependencies
195
237
 
196
238
  `erd.py` runs with **zero required dependencies** — everything below is optional, and
@@ -224,7 +266,8 @@ Feature highlights — each link goes to the relevant [manual](https://orapli.gi
224
266
  column comments, indexes, and real FK constraints, read from the database catalog
225
267
  (`information_schema` on MySQL, `pg_catalog` on PostgreSQL)
226
268
  - **Code semantics on top** — `--models` merges Rails / Prisma / Django associations;
227
- declared, DB-FK, and inferred edges stay [visually distinct](https://orapli.github.io/erdscope/manual.html#viewer-edges)
269
+ declared, DB-FK, schema FK (a statically-parsed `rails.schema` foreign key), and
270
+ inferred edges stay [visually distinct](https://orapli.github.io/erdscope/manual.html#viewer-edges)
228
271
  - **[Interactive exploration](https://orapli.github.io/erdscope/manual.html#viewer-guide)** — focus with depth and dependency
229
272
  direction, two-level hiding, table *and column* search (with regex/case toggles), a
230
273
  non-filtering Highlight search that survives into exports, named views, share links